Skip to content

Prod Deploy

Prod Deploy #322

Workflow file for this run

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