File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Push Docker Image
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ tags :
8
+ - ' v*'
9
+ pull_request :
10
+ branches :
11
+ - main
12
+
13
+ env :
14
+ ECR_REGISTRY : ${{ vars.ECR_REGISTRY }}
15
+ ECR_REPOSITORY : ${{ vars.ECR_REPOSITORY }}
16
+ AWS_REGION : ${{ vars.AWS_REGION }}
17
+
18
+ permissions :
19
+ id-token : write
20
+ contents : read
21
+
22
+ jobs :
23
+ build-and-push :
24
+ runs-on : [mend-self-hosted, profile=arch-small]
25
+
26
+ steps :
27
+ - name : Checkout code
28
+ uses : actions/checkout@v4
29
+
30
+ - name : Extract metadata
31
+ id : meta
32
+ uses : docker/metadata-action@v5
33
+ with :
34
+ images : ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}
35
+ tags : |
36
+ type=ref,event=branch
37
+ type=sha,prefix=sha-,format=short
38
+ type=raw,value=latest,enable={{is_default_branch}}
39
+
40
+ - name : Build and push Docker image
41
+ uses :
mend/gh-actions/.github/workflows/[email protected]
42
+ with :
43
+ repository : ${{ env.ECR_REPOSITORY }}
44
+ image-tag : ${{ steps.meta.outputs.tags }}
45
+ dockerfile-path : .
46
+ aws-role-to-assume : ${{ vars.AWS_IAM_ROLE_ARN }}
47
+ aws-region : ${{ env.AWS_REGION }}
48
+ push : ${{ github.event_name != 'pull_request' }}
You can’t perform that action at this time.
0 commit comments