From 1a9ca8fd32ac8621de8f41832bf1687775821ca0 Mon Sep 17 00:00:00 2001 From: sclaw Date: Wed, 7 Oct 2026 09:57:59 -0400 Subject: [PATCH] feat: make ECR push CI/CD generic so that repo can be swapped when pasting this file to other gh repositories. Also, update CICD job names. --- .github/workflows/ecr-image.yml | 8 +++++--- .github/workflows/infrastructure.yml | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ecr-image.yml b/.github/workflows/ecr-image.yml index 8bf1478..6837bb1 100644 --- a/.github/workflows/ecr-image.yml +++ b/.github/workflows/ecr-image.yml @@ -14,7 +14,7 @@ permissions: id-token: write jobs: - push: + push-image-to-ecr: if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: @@ -27,7 +27,7 @@ jobs: role-to-assume: ${{ vars.ECR_PUSH_ROLE_ARN }} aws-region: ${{ vars.AWS_REGION }} - name: Verify ECR repository - run: aws ecr describe-repositories --repository-names flows2fim --query 'repositories[0].repositoryName' --output text > /dev/null + run: aws ecr describe-repositories --repository-names ${{ vars.ECR_REPOSITORY_NAME }} --query 'repositories[0].repositoryName' --output text > /dev/null - uses: aws-actions/amazon-ecr-login@v2 id: login - uses: docker/setup-buildx-action@v3 @@ -37,4 +37,6 @@ jobs: target: prod push: true platforms: linux/amd64,linux/arm64 - tags: ${{ steps.login.outputs.registry }}/flows2fim:sha-${{ github.sha }} \ No newline at end of file + tags: | + ${{ steps.login.outputs.registry }}/${{ vars.ECR_REPOSITORY_NAME }}:sha-${{ github.sha }} + ${{ steps.login.outputs.registry }}/${{ vars.ECR_REPOSITORY_NAME }}:latest \ No newline at end of file diff --git a/.github/workflows/infrastructure.yml b/.github/workflows/infrastructure.yml index 55a51ab..0ee78ec 100644 --- a/.github/workflows/infrastructure.yml +++ b/.github/workflows/infrastructure.yml @@ -17,7 +17,7 @@ permissions: contents: read jobs: - validate: + validate-cdk-build: if: github.event_name == 'pull_request' runs-on: ubuntu-latest defaults: @@ -35,7 +35,7 @@ jobs: - run: uv run --locked pyright - run: uv run --locked cdk synth - deploy: + deploy-ecr-repo-with-cdk: if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' runs-on: ubuntu-latest defaults: