Skip to content

Commit ff5875f

Browse files
committed
test distributed build
1 parent 80128b6 commit ff5875f

File tree

1 file changed

+48
-8
lines changed

1 file changed

+48
-8
lines changed

.github/workflows/release-image.yaml

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ name: release-image
22

33
on:
44
push:
5-
tags:
6-
- "v*"
5+
branches:
6+
- "add-multiarch"
77

88
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 }}
1118
steps:
1219
- name: Set up Docker Buildx
1320
uses: docker/setup-buildx-action@v2
@@ -27,19 +34,52 @@ jobs:
2734
images: |
2835
${{ steps.ecr-login.outputs.registry }}/devsisters/checkpoint
2936
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 }}
3342
flavor:
3443
latest=auto
3544
- uses: actions/checkout@v3
3645
- name: Build and push container image to AWS ECR
3746
uses: docker/build-push-action@v4
3847
with:
3948
context: .
40-
push: true
49+
push: false
4150
cache-to: type=gha,mode=max
4251
cache-from: type=gha,mode=max
4352
platforms: linux/amd64,linux/arm64
4453
tags: ${{ steps.meta.outputs.tags }}
4554
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

Comments
 (0)