Skip to content

Commit

Permalink
update env for entire job
Browse files Browse the repository at this point in the history
  • Loading branch information
doridoro committed Jun 14, 2024
1 parent aacb276 commit 2aa4be9
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
test_app:
name: Testing the app
runs-on: ubuntu-latest
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }}
DEBUG: ${{ secrets.DEBUG }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -25,11 +31,6 @@ jobs:
run: flake8

- name: Run app tests
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }}
DEBUG: ${{ secrets.DEBUG }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
run: |
coverage run --source='.' --omit='oc_lettings_site/settings*','*/migrations/*' manage.py test --settings oc_lettings_site.settings-ci
coverage report --fail-under=80
Expand All @@ -39,23 +40,23 @@ jobs:
docker:
name: Docker
runs-on: ubuntu-latest
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }}
DEBUG: ${{ secrets.DEBUG }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
GITHUB-SHA: ${{ github.sha }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build the Docker image
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }}
DEBUG: ${{ secrets.DEBUG }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
run: |
docker build -t oc_lettings .
docker images
- name: Tag the Docker image
env:
GITHUB-SHA: ${{ github.sha }}
run: |
COMMIT_HASH=${GITHUB_SHA::7}
docker tag oc_lettings:latest doridoro/oc_lettings_site:$COMMIT_HASH
Expand All @@ -67,7 +68,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push Docker image to Docker Hub
run: docker push doridoro/oc_lettings_site:latest
run: docker push doridoro/oc_lettings_site:$COMMIT_HASH

# docker_actions:
# name: Docker
Expand Down

0 comments on commit 2aa4be9

Please sign in to comment.