Merge pull request #76 from truemark/develop-louie #314
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main-louie | |
- develop-louie | |
- hotfix/* | |
pull_request: | |
branches: | |
- main-louie | |
- develop-louie | |
- hotfix/* | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
build-maven: | |
name: Build Maven | |
uses: truemark/github-workflows/.github/workflows/build-maven.yml@argocd-demo | |
with: | |
version: 61.${{ github.run_number }}.${{ github.run_attempt }} | |
java_version: 21 | |
java_distribution: "corretto" | |
build-docker: | |
name: Build Docker | |
uses: truemark/github-workflows/.github/workflows/build-docker.yml@argocd-demo | |
with: | |
version: 61.${{ github.run_number }}.${{ github.run_attempt }} | |
image_name: "truemark/helloworld-java" | |
aws_region: "us-east-1" | |
secrets: | |
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 ] | |
cdk-diff-stage: | |
if: > | |
github.event_name == 'push' && (github.ref == 'refs/heads/develop-louie' || startsWith(github.ref, 'refs/heads/hotfix/')) | |
name: CDK diff to Stage | |
uses: truemark/github-workflows/.github/workflows/cdk-diff.yml@argocd-demo | |
with: | |
environment: "stage" | |
aws_region: "us-east-2" | |
secrets: | |
aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} | |
needs: [ build-maven ] | |
cdk-deploy-stage: | |
if: > | |
github.event_name == 'push' && (github.ref == 'refs/heads/develop-louie' || startsWith(github.ref, 'refs/heads/hotfix/')) | |
name: CDK deploy to Stage | |
uses: truemark/github-workflows/.github/workflows/cdk-deploy.yml@argocd-demo | |
with: | |
environment: "stage" | |
aws_region: "us-east-2" | |
secrets: | |
aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} | |
needs: [ cdk-diff-stage ] | |
eks-deploy-stage: | |
if: > | |
github.event_name == 'push' && (github.ref == 'refs/heads/develop-louie' || startsWith(github.ref, 'refs/heads/hotfix/')) | |
name: ArgoCD deploy to Stage | |
uses: truemark/github-workflows/.github/workflows/argo-deploy.yml@argocd-demo | |
with: | |
environment: "stage" | |
app_name: "hello-world" | |
secrets: | |
app-id: ${{ secrets.RELEASE_BOT_ID }} | |
private-key: ${{ secrets.RELEASE_BOT_KEY }} | |
needs: [ build-docker, cdk-deploy-stage ] | |
cdk-diff-prod: | |
if: > | |
github.event_name == 'push' && (github.ref == 'refs/heads/main-louie' || startsWith(github.ref, 'refs/heads/hotfix/')) | |
name: CDK diff to Prod | |
uses: truemark/github-workflows/.github/workflows/cdk-diff.yml@argocd-demo | |
with: | |
environment: "prod" | |
aws_region: "us-east-2" | |
secrets: | |
aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} | |
needs: [ build-maven ] | |
cdk-deploy-prod: | |
if: > | |
github.event_name == 'push' && (github.ref == 'refs/heads/main-louie' || startsWith(github.ref, 'refs/heads/hotfix/')) | |
name: CDK deploy to Prod | |
uses: truemark/github-workflows/.github/workflows/cdk-deploy.yml@argocd-demo | |
with: | |
environment: "prod" | |
aws_region: "us-east-2" | |
secrets: | |
aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} | |
needs: [ cdk-diff-prod ] | |
eks-deploy-prod: | |
if: > | |
github.event_name == 'push' && (github.ref == 'refs/heads/main-louie' || startsWith(github.ref, 'refs/heads/hotfix/')) | |
name: ArgoCD deploy to Prod | |
uses: truemark/github-workflows/.github/workflows/argo-deploy.yml@argocd-demo | |
with: | |
environment: "prod" | |
app_name: "hello-world" | |
secrets: | |
aws_assume_role: ${{ secrets.AWS_ASSUME_ROLE }} | |
app-id: ${{ secrets.RELEASE_BOT_ID }} | |
private-key: ${{ secrets.RELEASE_BOT_KEY }} | |
needs: [ build-docker, cdk-deploy-prod ] |