diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml index d8229d0..496d4d9 100644 --- a/.github/workflows/dev-build.yml +++ b/.github/workflows/dev-build.yml @@ -1,4 +1,4 @@ -### This is the Terraform-generated dev-build.yml workflow for the ecr-workflow-test-dev app repository ### +### This is the Terraform-generated dev-build.yml workflow for the ecr-workflow-test 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. ### @@ -28,7 +28,7 @@ jobs: - name: Set CPU Architecture id: setarch run: | - echo "### Architecture Selection" >> $GITHUB_STEP_SUMMARY + echo "### :abacus: Architecture Selection" >> $GITHUB_STEP_SUMMARY if [[ -f .aws-architecture ]]; then ARCH=$(cat .aws-architecture) echo "\`$ARCH\` was read from \`.aws-architecture\` and passed to the deploy job." >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/prod-promote.yml b/.github/workflows/prod-promote.yml index fba09f5..9721aee 100644 --- a/.github/workflows/prod-promote.yml +++ b/.github/workflows/prod-promote.yml @@ -11,8 +11,36 @@ permissions: contents: read jobs: + prep: + name: Prep for Promote + runs-on: ubuntu-latest + outputs: + cpuarch: ${{ steps.setarch.outputs.cpuarch }} + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Set CPU Architecture + id: setarch + run: | + echo "### :abacus: Architecture Selection" >> $GITHUB_STEP_SUMMARY + if [[ -f .aws-architecture ]]; then + ARCH=$(cat .aws-architecture) + echo "\`$ARCH\` was read from \`.aws-architecture\` and passed to the deploy job." >> $GITHUB_STEP_SUMMARY + else + ARCH="linux/amd64" + echo "No \`.aws-architecture\` file, so default \`$ARCH\` was passed to the deploy job." >> $GITHUB_STEP_SUMMARY + fi + if [[ "$ARCH" != "linux/arm64" && "$ARCH" != "linux/amd64" ]]; then + echo "$ARCH is INVALID architecture!" + echo "$ARCH is INVALID architecture!" >> $GITHUB_STEP_SUMMARY + exit 1 + fi + echo "cpuarch=$ARCH" >> $GITHUB_OUTPUT + deploy: - name: Prod Container Promote + needs: prep + name: Deploy uses: mitlibraries/.github/.github/workflows/ecr-multi-arch-promote-prod.yml@multi-arch-deploy secrets: inherit with: @@ -21,5 +49,6 @@ jobs: GHA_ROLE_PROD: ecr-workflow-test-gha-prod ECR_STAGE: "ecr-workflow-test-stage" ECR_PROD: "ecr-workflow-test-prod" + CPU_ARCH: ${{ needs.prep.outputs.cpuarch }} # FUNCTION: "" \ No newline at end of file diff --git a/.github/workflows/stage-build.yml b/.github/workflows/stage-build.yml index 1f83f86..2d477b7 100644 --- a/.github/workflows/stage-build.yml +++ b/.github/workflows/stage-build.yml @@ -1,4 +1,4 @@ -### This is the Terraform-generated dev-build.yml workflow for the ecr-workflow-test-stage app repository ### +### This is the Terraform-generated stage-build.yml workflow for the ecr-workflow-test 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. ### @@ -17,6 +17,7 @@ permissions: jobs: prep: + name: Prep for Build runs-on: ubuntu-latest outputs: cpuarch: ${{ steps.setarch.outputs.cpuarch }} @@ -27,7 +28,7 @@ jobs: - name: Set CPU Architecture id: setarch run: | - echo "### Architecture Selection" >> $GITHUB_STEP_SUMMARY + echo "### :abacus: Architecture Selection" >> $GITHUB_STEP_SUMMARY if [[ -f .aws-architecture ]]; then ARCH=$(cat .aws-architecture) echo "\`$ARCH\` was read from \`.aws-architecture\` and passed to the deploy job." >> $GITHUB_STEP_SUMMARY @@ -44,7 +45,7 @@ jobs: deploy: needs: prep - name: Stage Container Deploy + name: Stage Deploy uses: mitlibraries/.github/.github/workflows/ecr-multi-arch-deploy-stage.yml@multi-arch-deploy secrets: inherit with: