Skip to content

Commit

Permalink
Adjusting workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
erikrj committed Dec 11, 2023
1 parent 4565ce9 commit 9e77fd3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 36 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ jobs:
version: 61.${{ github.run_number }}.${{ github.run_attempt }}
java_version: 21
java_distribution: "corretto"
cdk-diff:
name: CDK Diff
uses: ./.github/workflows/cdk-diff.yml
with:
environment: "stage"
secrets:
aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }}
build-docker:
name: Build Docker
uses: ./.github/workflows/build-docker.yml
Expand All @@ -33,20 +26,28 @@ jobs:
docker_hub_username: ${{ secrets.DOCKER_HUB_USERNAME }}
docker_hub_password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
needs: [build-maven]
cdk-deploy:
name: CDK Deploy
uses: ./.github/workflows/cdk-deploy.yml
with:
environment: "stage"
secrets:
aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }}
needs: [ build-maven ]
deploy-stage:
if: github.ref == 'refs/heads/main'
name: Deploy to Stage
uses: ./.github/workflows/eks-deploy.yml
with:
environment: "stage"
version: 61.${{ github.run_number }}.${{ github.run_attempt }}
needs: [build-docker]
needs: [build-docker, cdk-deploy]
deploy-prod:
if: github.ref == 'refs/heads/main'
name: Deploy to Prod
uses: ./.github/workflows/eks-deploy.yml
with:
environment: "prod"
version: 61.${{ github.run_number }}.${{ github.run_attempt }}
needs: [deploy-stage]
needs: [deploy-stage, cdk-deploy]

27 changes: 27 additions & 0 deletions .github/workflows/cdk-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
workflow_call:
secrets:
aws_assume_role:
description: "AWS role to assume"
required: false
inputs:
environment:
description: "Environment to deploy to"
required: true
type: string
jobs:
diff:
runs-on: public.ecr.aws/truemark/aws-cdk:ubuntu
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: "${{ secrets.aws_assume_role }}"
aws-region: "us-east-2"

- name: CDK Diff
run: |
cdk -c env=${{ inputs.environment }} diff
27 changes: 0 additions & 27 deletions .github/workflows/cdk-diff.yml

This file was deleted.

0 comments on commit 9e77fd3

Please sign in to comment.