@@ -2,12 +2,19 @@ name: release-image
2
2
3
3
on :
4
4
push :
5
- tags :
6
- - " v* "
5
+ branches :
6
+ - " add-multiarch "
7
7
8
8
jobs :
9
- release-image :
10
- runs-on : ubuntu-latest
9
+ build-image :
10
+ strategy :
11
+ matrix :
12
+ config :
13
+ - arch : amd64
14
+ runs_on : shared-8cpu-x64
15
+ - arch : arm64
16
+ runs_on : shared-8cpu-arm64
17
+ runs-on : ${{ matrix.config.runs_on }}
11
18
steps :
12
19
- name : Set up Docker Buildx
13
20
uses : docker/setup-buildx-action@v2
@@ -27,19 +34,52 @@ jobs:
27
34
images : |
28
35
${{ steps.ecr-login.outputs.registry }}/devsisters/checkpoint
29
36
tags : |
30
- type=semver,pattern={{version}}
31
- type=semver,pattern={{major}}.{{minor}}
32
- type=semver,pattern={{major}}
37
+ type=sha,format=short,suffix=-${{ matrix.config.arch }}
38
+ type=sha,format=long,suffix=-${{ matrix.config.arch }}
39
+ type=semver,pattern={{version}},suffix=-${{ matrix.config.arch }}
40
+ type=semver,pattern={{major}}.{{minor}},suffix=-${{ matrix.config.arch }}
41
+ type=semver,pattern={{major}},suffix=-${{ matrix.config.arch }}
33
42
flavor :
34
43
latest=auto
35
44
- uses : actions/checkout@v3
36
45
- name : Build and push container image to AWS ECR
37
46
uses : docker/build-push-action@v4
38
47
with :
39
48
context : .
40
- push : true
49
+ push : false
41
50
cache-to : type=gha,mode=max
42
51
cache-from : type=gha,mode=max
43
52
platforms : linux/amd64,linux/arm64
44
53
tags : ${{ steps.meta.outputs.tags }}
45
54
labels : ${{ steps.meta.outputs.labels }}
55
+
56
+ build-manifest :
57
+ needs : [build-image]
58
+ runs-on : " shared-2cpu-arm64"
59
+ steps :
60
+ - name : Docker meta
61
+ id : meta
62
+ uses : docker/metadata-action@v4
63
+ with :
64
+ images : |
65
+ ${{ steps.ecr-login.outputs.registry }}/devsisters/checkpoint
66
+ tags : |
67
+ type=sha,format=short,suffix=-${{ matrix.config.arch }}
68
+ type=sha,format=long,suffix=-${{ matrix.config.arch }}
69
+ type=semver,pattern={{version}}
70
+ type=semver,pattern={{major}}.{{minor}}
71
+ type=semver,pattern={{major}}
72
+ flavor :
73
+ latest=auto
74
+ - name : Login to AWS ECR
75
+ uses : aws-actions/amazon-ecr-login@v1
76
+ id : ecr-login
77
+ env :
78
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
79
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
80
+ AWS_REGION : us-east-1
81
+ with :
82
+ registry-type : public
83
+ - name : Create image manifest
84
+ run : |
85
+ echo ${{ steps.meta.outputs.tags }}
0 commit comments