-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (105 loc) · 3.68 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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 ]