From 7460549910bdf1e388636b15a2e485397daa342b Mon Sep 17 00:00:00 2001 From: Christopher Butler Date: Thu, 31 Aug 2023 11:16:50 -0400 Subject: [PATCH] Create Stage and Prod Automation Workflows Why these changes are being introduced: With the changes from mitlib-tf-workloads-ecr pushed to Dev1, Stage-Workloads, and Prod-Workloads, we can finish the GitHub Actions workflows for this repository. How this addresses that need: * Create the stage_build workflow for automated build/push of the container to ECR (triggered by commits to the `main` branch) * Create the prod_promote workflow for automated download from stage and upload to prod ECR (triggered by tagged release on the `main` branch) Side effects of this change: None. Other than the fact that every commit to the `main` branch will now automatically update the container image in the Stage-Workloads ECR repository Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/ENSY-177 --- .github/workflows/prod_promote.yml | 20 ++++++++++++++++++++ .github/workflows/stage_build.yml | 24 ++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/workflows/prod_promote.yml create mode 100644 .github/workflows/stage_build.yml diff --git a/.github/workflows/prod_promote.yml b/.github/workflows/prod_promote.yml new file mode 100644 index 0000000..ee1d536 --- /dev/null +++ b/.github/workflows/prod_promote.yml @@ -0,0 +1,20 @@ +### This is the Terraform-generated prod-promote.yml workflow for the alma-bursartransfer-prod repository. ### +### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document. ### +name: Prod Container Promote +on: + workflow_dispatch: + release: + types: [published] + +jobs: + deploy: + name: Prod Container Promote + uses: mitlibraries/.github/.github/workflows/ecr-shared-promote-prod.yml@main + secrets: inherit + with: + AWS_REGION: "us-east-1" + GHA_ROLE_STAGE: alma-bursartransfer-gha-stage + GHA_ROLE_PROD: alma-bursartransfer-gha-prod + ECR_STAGE: "alma-bursartransfer-stage" + ECR_PROD: "alma-bursartransfer-prod" + FUNCTION: "alma-bursartransfer-prod" diff --git a/.github/workflows/stage_build.yml b/.github/workflows/stage_build.yml new file mode 100644 index 0000000..19568b0 --- /dev/null +++ b/.github/workflows/stage_build.yml @@ -0,0 +1,24 @@ +### This is the Terraform-generated dev-build.yml workflow for the alma-bursartransfer-stage app repository ### +### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document ### +### If the container requires any additional pre-build commands, uncomment and edit ### +### the PREBUILD line at the end of the document. ### +name: Stage Container Build and Deploy +on: + workflow_dispatch: + push: + branches: + - main + paths-ignore: + - '.github/**' + +jobs: + deploy: + name: Stage Container Deploy + uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-stage.yml@main + secrets: inherit + with: + AWS_REGION: "us-east-1" + GHA_ROLE: "alma-bursartransfer-gha-stage" + ECR: "alma-bursartransfer-stage" + FUNCTION: "alma-bursartransfer-stage" + # PREBUILD: