Skip to content

set DATABASE_URL environment variable #52

set DATABASE_URL environment variable

set DATABASE_URL environment variable #52

Workflow file for this run

name: Django CI/CD
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
strategy:
max-parallel: 4
matrix:
python-version: [3.8, 3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_workflow.txt
- name: Run Tests and Coverage
run: |
coverage run manage.py test
- name: Generate Coverage Report
run: |
coverage report -m
coverage xml
- name: Check Coverage
run: |
coverage report --fail-under=85
deploy:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
- name: Test
run: |
echo "Running tests..."
- name: Deploy
# Only run this step if the branch is main
if: github.ref == 'refs/heads/main'
env:
deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }}
run: |
curl "$deploy_url"