Repository navigation
Prod Deploy #322
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Prod Deploy | |
| on: | |
| workflow_run: | |
| workflows: ["CI"] | |
| types: [completed] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| concurrency: | |
| group: prod-deploy | |
| cancel-in-progress: true | |
| jobs: | |
| approve: | |
| if: >- | |
| ${{ | |
| github.event.workflow_run.conclusion == 'success' && | |
| github.event.workflow_run.head_branch == 'main' | |
| }} | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: prod | |
| steps: | |
| - name: Queue prod deploy | |
| run: echo "Preparing prod deploy for ${{ github.event.workflow_run.head_sha }}" | |
| deploy-backend: | |
| needs: approve | |
| uses: ./.github/workflows/reusable-deploy-backend.yml | |
| with: | |
| deploy_ref: ${{ github.event.workflow_run.head_sha }} | |
| aws_region: us-east-2 | |
| ecr_repository: prod/doenet | |
| ecs_cluster: prod | |
| ecs_service: doenet-FARGATE | |
| gha_role: arn:aws:iam::350646758180:role/github-actions-prod | |
| sns_topic: arn:aws:sns:us-east-2:350646758180:prod-critical-cloudwatch-notifications | |
| tag_name: main | |
| secrets: inherit | |
| deploy-frontend: | |
| needs: approve | |
| uses: ./.github/workflows/reusable-deploy-frontend.yml | |
| with: | |
| deploy_ref: ${{ github.event.workflow_run.head_sha }} | |
| aws_region: us-east-1 | |
| gha_role: arn:aws:iam::350646758180:role/github-actions-prod | |
| aws_account_id: "350646758180" | |
| env_name: prod | |
| build_mode: prod | |
| secrets: inherit | |
| deploy-site: | |
| needs: approve | |
| uses: ./.github/workflows/reusable-deploy-site.yml | |
| with: | |
| deploy_ref: ${{ github.event.workflow_run.head_sha }} | |
| aws_region: us-east-1 | |
| gha_role: arn:aws:iam::350646758180:role/github-actions-prod | |
| aws_account_id: "350646758180" | |
| env_name: prod | |
| build_mode: prod | |
| secrets: inherit | |
| tag-prod: | |
| needs: | |
| - approve | |
| - deploy-backend | |
| - deploy-frontend | |
| - deploy-site | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.workflow_run.head_sha }} | |
| - name: Update prod tag | |
| shell: bash | |
| run: | | |
| DEPLOY_REF="${{ github.event.workflow_run.head_sha }}" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git tag -f prod "$DEPLOY_REF" | |
| git push origin refs/tags/prod --force |