File tree Expand file tree Collapse file tree 6 files changed +37
-24
lines changed
Expand file tree Collapse file tree 6 files changed +37
-24
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches : ["main"]
66 tags :
7- - " backend@ STAGING-v*"
8- - " backend@ v*"
7+ - " STAGING-v*"
8+ - " v*"
99
1010env :
1111 AWS_REGION : ap-southeast-1
3333 id : login-ecr
3434 uses : aws-actions/amazon-ecr-login@v1
3535
36+ - name : Determine environment and image
37+ id : determine-env
38+ run : |
39+ if [[ ${{ github.ref }} == refs/tags/STAGING-v* ]]; then
40+ echo "ENVIRONMENT=staging" >> $GITHUB_OUTPUT
41+ echo "IMAGE=${{ env.IMAGE }}" >> $GITHUB_OUTPUT
42+ else
43+ echo "ENVIRONMENT=development" >> $GITHUB_OUTPUT
44+ echo "IMAGE=${{ env.IMAGE }}" >> $GITHUB_OUTPUT
45+ fi
46+
3647 - name : Extract metadata (tags, labels) for Docker
3748 id : meta
3849 uses : docker/metadata-action@v5
4253 tags : |
4354 type=sha
4455
45- - name : Determine environment
46- id : determine-env
47- run : |
48- if [[ ${{ github.ref }} == refs/tags/backend@STAGING-v* ]]; then
49- echo "ENVIRONMENT=staging" >> $GITHUB_OUTPUT
50- elif [[ ${{ github.ref }} == refs/tags/backend@v* ]]; then
51- echo "ENVIRONMENT=production" >> $GITHUB_OUTPUT
52- else
53- echo "ENVIRONMENT=development" >> $GITHUB_OUTPUT
54- fi
55-
5656 - name : Build and push Docker images
5757 uses : docker/build-push-action@v5
5858 with :
Original file line number Diff line number Diff line change 1010 - protocol : TCP
1111 port : 8000
1212 targetPort : 8000
13- ---
14- apiVersion : elbv2.k8s.aws/v1beta1
15- kind : TargetGroupBinding
16- metadata :
17- name : hansards-back
18- spec :
19- serviceRef :
20- name : hansards-back
21- port : 8000
22- targetGroupARN : arn:aws:elasticloadbalancing:ap-southeast-1:767397910274:targetgroup/hansards-back/405d7e014da59c37
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : elbv2.k8s.aws/v1beta1
3+ kind : TargetGroupBinding
4+ metadata :
5+ name : hansards-back
6+ spec :
7+ serviceRef :
8+ name : hansards-back
9+ port : 8000
10+ targetGroupARN : arn:aws:elasticloadbalancing:ap-southeast-1:767397910274:targetgroup/hansards-back/405d7e014da59c37
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22kind : Kustomization
33resources :
44 - ../../base
5+ - ingress.yaml
56images :
67 - name : IMAGE_NAME_PLACEHOLDER
78 # Use the correct image from AWS ECR!
89 newName : 767397910274.dkr.ecr.ap-southeast-1.amazonaws.com/hansards-back
10+ namespace : hansards
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : elbv2.k8s.aws/v1beta1
3+ kind : TargetGroupBinding
4+ metadata :
5+ name : hansards-back
6+ spec :
7+ serviceRef :
8+ name : hansards-back
9+ port : 8000
10+ targetGroupARN : arn:aws:elasticloadbalancing:ap-southeast-1:767397910274:targetgroup/hansards-back-staging/7db92f970181dcea
Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22kind : Kustomization
33resources :
44 - ../../base
5-
5+ - ingress.yaml
66images :
77 - name : IMAGE_NAME_PLACEHOLDER
88 # Use the correct image from AWS ECR!
99 newName : 767397910274.dkr.ecr.ap-southeast-1.amazonaws.com/hansards-back
10+ namespace : hansards-staging # deploy to dev cluster but different namespace
You can’t perform that action at this time.
0 commit comments