From e6d24f3a69628af2232da87cbcaa86c45dec4211 Mon Sep 17 00:00:00 2001 From: Manasa Venkatakrishnan Date: Mon, 16 Oct 2023 10:53:53 -0700 Subject: [PATCH] Adding prod deploy --- .github/workflows/prod-deploy.yml | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/prod-deploy.yml diff --git a/.github/workflows/prod-deploy.yml b/.github/workflows/prod-deploy.yml new file mode 100644 index 000000000..b386f099d --- /dev/null +++ b/.github/workflows/prod-deploy.yml @@ -0,0 +1,49 @@ +on: + schedule: + - cron: "30 10 * * TUE" + +permissions: + id-token: write + contents: read + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + #TODO: Add frontend validation and release notes publishing before triggering release + + deploy-to-prod: + name: deploy prod branch + runs-on: ubuntu-latest + environment: prod + if: github.repository == 'chanzuckerberg/cryoet-data-portal' + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + mask-aws-account-id: true + aws-region: ${{ secrets.AWS_REGION }} + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} + role-duration-seconds: 1200 + - name: Login to ECR + uses: docker/login-action@v2 + with: + registry: ${{ secrets.ECR_REPO }} + - name: Create or update stack + uses: chanzuckerberg/github-actions/.github/actions/deploy-happy-stack@v1.24.0 + env: + # Force using BuildKit instead of normal Docker, required so that metadata + # is written/read to allow us to use layers of previous builds as cache. + DOCKER_BUILDKIT: 1 + COMPOSE_DOCKER_CLI_BUILD: 1 + DOCKER_REPO: ${{ secrets.ECR_REPO }}/ + ENV: prod + with: + stack-name: prod + create-tag: true + tag: ${{ env.STACK_NAME }} + tfe-token: ${{ secrets.TFE_TOKEN }} + working-directory: ./frontend + env: prod + operation: create-or-update