Skip to content

Commit

Permalink
Merge pull request #738 from dimagi/sk/deploy-tweaks
Browse files Browse the repository at this point in the history
deploy after tests complete + create deployment in github
  • Loading branch information
snopoke authored Oct 17, 2024
2 parents 8eb10ba + 01a29d1 commit 06cc56c
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ on:
options:
- dev
- prod
push:
branches: [ "main" ]
workflow_run:
workflows: [ Run Django Tests, Build Front End ]
types:
- completed

permissions:
id-token: write
contents: read
deployments: write

jobs:
deploy:
Expand Down Expand Up @@ -64,6 +67,15 @@ jobs:
echo "ECS_SERVICE_CELERY=$APP_NAME-${{ env.DEPLOY_ENV }}-Celery" >> "$GITHUB_ENV"
echo "ECS_SERVICE_CELERY_BEAT=$APP_NAME-${{ env.DEPLOY_ENV }}-CeleryBeat" >> "$GITHUB_ENV"
- name: Create GitHub deployment
uses: chrnorm/deployment-action@v2
id: deployment
with:
token: '${{ github.token }}'
environment: "aws-${{ env.DEPLOY_ENV }}"
production-environment: ${{ env.DEPLOY_ENV == 'prod' }}


- name: configure aws credentials
uses: aws-actions/[email protected]
with:
Expand Down Expand Up @@ -157,3 +169,21 @@ jobs:
- name: Wait for service stability
run: |
aws ecs wait services-stable --cluster $ECS_CLUSTER --services $ECS_SERVICE_DJANGO $ECS_SERVICE_CELERY $ECS_SERVICE_CELERY_BEAT
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@v2
with:
token: '${{ github.token }}'
environment-url: ${{ steps.deployment.outputs.environment_url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: 'success'

- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@v2
with:
token: '${{ github.token }}'
environment-url: ${{ steps.deployment.outputs.environment_url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: 'failure'

0 comments on commit 06cc56c

Please sign in to comment.