Skip to content

Commit

Permalink
Clean up the main.yml deployment file
Browse files Browse the repository at this point in the history
Also run the deployment for real
  • Loading branch information
pcraig3 committed Nov 19, 2024
1 parent 8c0bd9f commit 2ce39d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/django_gcp_migrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ jobs:
- name: Run migration
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: poetry run python manage.py migrate --plan
run: poetry run python manage.py migrate
16 changes: 3 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,14 @@ on:
- main

jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: Debug event
run: |
echo "Event name: ${{ github.event_name }}"
echo "ref_name: ${{ github.ref_name }}"
echo "ref: ${{ github.ref }}"
ci:
uses: ./.github/workflows/django_ci.yml # Call the CI workflow
with:
branch: ${{ github.ref_name }}
secrets: inherit

migrate:
# if: github.event_name == 'push' && github.ref_name == 'main'
if: github.event_name == 'pull_request' && github.ref_name == '52/merge'
if: github.event_name == 'push' && github.ref_name == 'main'
needs: ci
uses: ./.github/workflows/django_gcp_migrate.yml
secrets:
Expand All @@ -37,8 +27,8 @@ jobs:
GCP_IAM_SA_CREDENTIALS: ${{ secrets.GCP_IAM_SA_CREDENTIALS }}

deploy:
if: github.event_name == 'pull_request' && github.ref_name == '52/merge'
needs: ci
if: github.event_name == 'push' && github.ref_name == 'main'
needs: migrate
uses: ./.github/workflows/django_gcp_deploy.yml # Call the Deploy workflow
with:
github_sha: ${{ github.sha }}
Expand Down

0 comments on commit 2ce39d3

Please sign in to comment.