Skip to content

Commit

Permalink
fix: add env to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucerna00 committed May 18, 2024
1 parent aad5de5 commit 43e0d31
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Django CI
name: Django CI/CD

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
max-parallel: 4
matrix:
Expand All @@ -25,6 +25,21 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create env file
run: |
echo "SECRET_KEY=$SECRET_KEY" >> .env
echo "DB_NAME=$DB_NAME" >> .env
echo "DB_USER=$DB_USER" >> .env
echo "DB_PASSWORD=$DB_PASSWORD" >> .env
echo "DB_HOST=$DB_HOST" >> .env
echo "DB_PORT=$DB_PORT" >> .env
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
- name: Run Tests
run: |
python manage.py test

0 comments on commit 43e0d31

Please sign in to comment.