@@ -37,26 +37,32 @@ jobs:
3737 if : ${{ github.ref == 'refs/heads/master' }}
3838 environment :
3939 name : prod
40+
4041 permissions :
4142 id-token : write
4243 contents : read
44+
4345 env :
4446 CLUSTER_NAME : Workflows
47+
4548 steps :
4649 - uses : linz/action-typescript@9bf69b0f313b3525d3ba3116f26b1aff7eb7a6c0 # v3.1.0
4750 with :
4851 node-version : 20.x
52+
4953 # Configure access to AWS / EKS
5054 - name : Setup kubectl
5155 uses : azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v3
5256 with :
5357 version : ' latest'
58+
5459 - name : AWS Configure
5560 uses : aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4
5661 with :
5762 aws-region : ap-southeast-2
5863 mask-aws-account-id : true
5964 role-to-assume : ${{ secrets.AWS_CI_ROLE }}
65+
6066 - name : Find Changes in Infra
6167 id : get-infra-changes
6268 run : |
@@ -66,31 +72,39 @@ jobs:
6672 else
6773 echo "run_infra=false" >> "$GITHUB_OUTPUT"
6874 fi
75+
6976 - name : (CDK) Deploy
7077 if : steps.get-infra-changes.outputs.run_infra == 'true'
7178 run : |
7279 npx cdk deploy ${{ env.CLUSTER_NAME }} \
73- -c maintainer-arns=${{ secrets.AWS_CI_ROLE }},${{ secrets.AWS_ADMIN_ROLE }},${{ secrets.AWS_WFMAINTAINER_ROLE }} \
80+ -c maintainer-arns=${{ secrets.AWS_CI_ROLE }},${{ secrets.AWS_ADMIN_ROLE }},${{ secrets.AWS_ADMIN_SSO_ROLE }},${{ secrets. AWS_WFMAINTAINER_ROLE }} \
7481 -c aws-account-id=${{ secrets.AWS_ACCOUNT_ID }} \
7582 --require-approval never
83+ env :
84+ NODE_ENV : production
85+
7686 - name : Login to EKS
7787 run : |
7888 aws eks update-kubeconfig --name ${{ env.CLUSTER_NAME }} --region ap-southeast-2
89+
7990 - name : Check EKS connection
8091 run : |
8192 kubectl get nodes
93+
8294 # Configure the Kubernetes cluster with CDK8s
8395 - name : (CDK8s) Synth
8496 if : steps.get-infra-changes.outputs.run_infra == 'true'
8597 run : |
8698 npx cdk8s synth
8799 # nb: kubectl diff - is somewhat dangerous as it dumps out secrets in plain text
88100 # so it should not be used in this pipeline
101+
89102 # TODO use a --prune and --applyset to remove unused objects
90103 - name : (CDK8s) Deploy
91104 if : steps.get-infra-changes.outputs.run_infra == 'true'
92105 run : |
93106 kubectl apply -f dist/
107+
94108 - name : Deploy workflows
95109 if : github.ref == 'refs/heads/master'
96110 run : |
@@ -118,12 +132,14 @@ jobs:
118132 for cwf in $CRON_WORKFLOWS; do
119133 kubectl apply -f "$cwf" --namespace argo
120134 done
135+
121136 - name : Install Argo
122137 if : steps.get-infra-changes.outputs.run_infra == 'true'
123138 run : |
124139 curl --location --remote-name --silent "${{ env.ARGO_URL }}"
125140 gunzip argo-linux-amd64.gz
126141 chmod +x argo-linux-amd64
142+
127143 - name : Smoke test
128144 if : steps.get-infra-changes.outputs.run_infra == 'true'
129145 run : |
0 commit comments