From 7e56d20384f6ce6b72d68d153213b890db87cec0 Mon Sep 17 00:00:00 2001 From: Louie Celli Date: Mon, 15 Jul 2024 12:51:59 -0600 Subject: [PATCH 1/7] Testing out different workflow patterns. --- .github/workflows/build.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 562bc817..4f2fc436 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }} docker_hub_password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - needs: [build-maven] + needs: [ build-maven ] cdk-diff-stage: if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/') name: CDK diff to Stage @@ -45,14 +45,23 @@ jobs: environment: "stage" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [cdk-diff-stage, build-docker] + needs: [ cdk-diff-stage, build-docker ] eks-deploy-stage: if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/') name: EKS deploy to Stage uses: ./.github/workflows/eks-deploy.yml with: environment: "stage" - needs: [cdk-diff-stage, build-docker, cdk-deploy-stage] + needs: [ cdk-diff-stage, build-docker ] + cdk-diff-prod: + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/') + name: CDK diff to Prod + uses: ./.github/workflows/cdk-diff.yml + with: + environment: "prod" + secrets: + aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} + needs: [ build-maven ] cdk-deploy-prod: if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/') name: CDK deploy to Prod @@ -61,7 +70,7 @@ jobs: environment: "prod" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [cdk-diff-stage, build-docker] + needs: [ cdk-diff-prod, build-docker ] eks-deploy-prod: if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/') name: EKS deploy to Prod @@ -70,4 +79,4 @@ jobs: environment: "prod" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [cdk-deploy-prod] + needs: [ cdk-deploy-prod ] From e9b4f98163a9bddbdef5d2a5aff0b95ec58499d1 Mon Sep 17 00:00:00 2001 From: Louie Celli Date: Mon, 15 Jul 2024 12:57:09 -0600 Subject: [PATCH 2/7] Testing a different configuration. --- .github/workflows/build.yml | 6 +++--- .github/workflows/cdk-deploy.yml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f2fc436..eec22282 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,14 +45,14 @@ jobs: environment: "stage" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ cdk-diff-stage, build-docker ] + needs: [ cdk-diff-stage ] eks-deploy-stage: if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/') name: EKS deploy to Stage uses: ./.github/workflows/eks-deploy.yml with: environment: "stage" - needs: [ cdk-diff-stage, build-docker ] + needs: [ cdk-deploy-stage ] cdk-diff-prod: if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/') name: CDK diff to Prod @@ -61,7 +61,7 @@ jobs: environment: "prod" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ build-maven ] + needs: [ build-maven, build-docker ] cdk-deploy-prod: if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/') name: CDK deploy to Prod diff --git a/.github/workflows/cdk-deploy.yml b/.github/workflows/cdk-deploy.yml index eed8321d..2874532d 100644 --- a/.github/workflows/cdk-deploy.yml +++ b/.github/workflows/cdk-deploy.yml @@ -14,6 +14,7 @@ jobs: runs-on: ubuntu-latest container: # Replace with GitHub action in the future image: public.ecr.aws/truemark/aws-cdk:ubuntu + environment: ${{ inputs.environment }} steps: - uses: actions/checkout@v4 From bc41ea31771a737aab04b163b3f0a4ee69d1d338 Mon Sep 17 00:00:00 2001 From: Louie Celli Date: Mon, 15 Jul 2024 13:06:01 -0600 Subject: [PATCH 3/7] Another configuration test. --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eec22282..60492fbc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,7 @@ jobs: version: 61.${{ github.run_number }}.${{ github.run_attempt }} java_version: 21 java_distribution: "corretto" + build-docker: name: Build Docker uses: ./.github/workflows/build-docker.yml @@ -28,6 +29,7 @@ jobs: docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }} docker_hub_password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} needs: [ build-maven ] + cdk-diff-stage: if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/') name: CDK diff to Stage @@ -37,6 +39,7 @@ jobs: secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} needs: [ build-maven ] + cdk-deploy-stage: if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/') name: CDK deploy to Stage @@ -46,6 +49,7 @@ jobs: secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} needs: [ cdk-diff-stage ] + eks-deploy-stage: if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/') name: EKS deploy to Stage @@ -53,6 +57,7 @@ jobs: with: environment: "stage" needs: [ cdk-deploy-stage ] + cdk-diff-prod: if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/') name: CDK diff to Prod @@ -61,7 +66,8 @@ jobs: environment: "prod" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ build-maven, build-docker ] + needs: [ build-docker ] + cdk-deploy-prod: if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/') name: CDK deploy to Prod @@ -70,7 +76,8 @@ jobs: environment: "prod" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ cdk-diff-prod, build-docker ] + needs: [ cdk-diff-prod ] + eks-deploy-prod: if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/') name: EKS deploy to Prod From 3d245134ad29ee57f1dcd277c1b0310a8e6cdb84 Mon Sep 17 00:00:00 2001 From: Louie Celli Date: Mon, 15 Jul 2024 13:24:35 -0600 Subject: [PATCH 4/7] Another configuration test. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60492fbc..16dda8aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: environment: "stage" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ cdk-diff-stage ] + needs: [ build-docker, cdk-diff-stage ] eks-deploy-stage: if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/') @@ -66,7 +66,7 @@ jobs: environment: "prod" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ build-docker ] + needs: [ build-maven ] cdk-deploy-prod: if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/') @@ -86,4 +86,4 @@ jobs: environment: "prod" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ cdk-deploy-prod ] + needs: [ cdk-deploy-prod, eks-deploy-stage ] From 36624360fb61daf97e32f5e7e19bb38bc7a63f60 Mon Sep 17 00:00:00 2001 From: Louie Celli Date: Mon, 15 Jul 2024 13:31:09 -0600 Subject: [PATCH 5/7] Another configuration test. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16dda8aa..e2cee9a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,4 +86,4 @@ jobs: environment: "prod" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ cdk-deploy-prod, eks-deploy-stage ] + needs: [ cdk-deploy-prod ] From 150da938514642e10bcd08bd469c41c9b5bd9f79 Mon Sep 17 00:00:00 2001 From: Louie Celli Date: Mon, 15 Jul 2024 13:32:59 -0600 Subject: [PATCH 6/7] Another configuration test. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e2cee9a7..559c014d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ jobs: environment: "stage" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ build-maven ] + needs: [ build-maven, build-docker ] cdk-deploy-stage: if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/') @@ -66,7 +66,7 @@ jobs: environment: "prod" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ build-maven ] + needs: [ build-maven, build-docker ] cdk-deploy-prod: if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/hotfix/') From 97ac7d64ed522b305314c209ac36a00611632718 Mon Sep 17 00:00:00 2001 From: Louie Celli Date: Mon, 15 Jul 2024 13:35:42 -0600 Subject: [PATCH 7/7] Another configuration test. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 559c014d..85988e7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: environment: "stage" secrets: aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} - needs: [ build-docker, cdk-diff-stage ] + needs: [ cdk-diff-stage ] eks-deploy-stage: if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')