Skip to content

Commit e15abda

Browse files
authored
ci(publish): build on blacksmith-arm (#23)
again
1 parent a61fb87 commit e15abda

File tree

4 files changed

+103
-19
lines changed

4 files changed

+103
-19
lines changed

.github/workflows/publish-2.7.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- '2.7/**'
1111
schedule:
1212
- cron: '0 9 * * 2,6'
13-
- cron: '30 6 1 * *'
13+
- cron: '30 6 2 * *'
1414

1515
jobs:
1616
publish:
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
image: coatldev/python
3535
version: ${{ matrix.image.version }}
36-
build-cache: ${{ github.event.schedule == '30 6 1 * *' && 'false' || 'true' }}
36+
build-cache: ${{ github.event.schedule == '0 7 1 * *' && 'false' || 'true' }}
3737
variant: ${{ matrix.image.variant }}
3838
tags: ${{ matrix.image.tags }}
3939
username: ${{ vars.DOCKERHUB_USERNAME }}

.github/workflows/publish-3.12.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- '3.12/**'
1111
schedule:
1212
- cron: '0 9 * * 1,5'
13-
- cron: '30 6 1 * *'
13+
- cron: '0 7 1 * *'
1414

1515
jobs:
1616
tagger:
@@ -60,7 +60,7 @@ jobs:
6060
with:
6161
image: coatldev/python
6262
version: ${{ matrix.image.version }}
63-
build-cache: ${{ github.event.schedule == '30 6 1 * *' && 'false' || 'true' }}
63+
build-cache: ${{ github.event.schedule == '0 7 1 * *' && 'false' || 'true' }}
6464
variant: ${{ matrix.image.variant }}
6565
tags: ${{ matrix.image.tags }}
6666
username: ${{ vars.DOCKERHUB_USERNAME }}

.github/workflows/publish-3.13.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- '3.13/**'
1111
schedule:
1212
- cron: '0 9 * * 0,4'
13-
- cron: '30 6 1 * *'
13+
- cron: '0 7 1 * *'
1414

1515
jobs:
1616
tagger:
@@ -62,7 +62,7 @@ jobs:
6262
with:
6363
image: coatldev/python
6464
version: ${{ matrix.image.version }}
65-
build-cache: ${{ github.event.schedule == '30 6 1 * *' && 'false' || 'true' }}
65+
build-cache: ${{ github.event.schedule == '0 7 1 * *' && 'false' || 'true' }}
6666
variant: ${{ matrix.image.variant }}
6767
tags: ${{ matrix.image.tags }}
6868
username: ${{ vars.DOCKERHUB_USERNAME }}

.github/workflows/publish.yml

Lines changed: 97 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,100 @@ on:
4141
required: true
4242

4343
jobs:
44-
publish:
45-
uses: coatl-dev/workflows/.github/workflows/docker-build-push-multi-platform.yml@v4
46-
with:
47-
registry-image: ${{ inputs.image }}
48-
metadata-tags: |
49-
${{ inputs.tags }}
50-
registry-username: ${{ inputs.username }}
51-
build-file: ${{ inputs.version }}/${{ inputs.variant }}/Dockerfile
52-
build-cache-key: ${{ inputs.version }}-${{ inputs.variant }}
53-
build-cache: ${{ fromJson(inputs.build-cache) }}
54-
build-digest-key: ${{ inputs.version }}-${{ inputs.variant }}
55-
secrets:
56-
registry-password: ${{ secrets.password }}
44+
build:
45+
runs-on: ${{ matrix.builder.runner-image }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
builder:
50+
- runner-image: ubuntu-24.04
51+
platform: linux/amd64
52+
- runner-image: blacksmith-arm
53+
platform: linux/arm64
54+
steps:
55+
- name: Prepare
56+
run: |
57+
platform=${{ matrix.builder.platform }}
58+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
59+
60+
- name: Docker meta
61+
id: meta
62+
uses: docker/metadata-action@v5
63+
with:
64+
images: |
65+
${{ inputs.image }}
66+
67+
- name: Set up Docker Buildx
68+
uses: docker/setup-buildx-action@v3
69+
70+
- name: Login to Docker registry
71+
uses: docker/login-action@v3
72+
with:
73+
username: ${{ inputs.username }}
74+
password: ${{ secrets.password }}
75+
76+
- name: Build and push by digest
77+
id: build
78+
uses: docker/build-push-action@v6
79+
with:
80+
cache-from: type=gha,scope=${{ inputs.version }}-${{ inputs.variant }}-${{ env.PLATFORM_PAIR }}
81+
cache-to: type=gha,scope=${{ inputs.version }}-${{ inputs.variant }}-${{ env.PLATFORM_PAIR }},mode=max
82+
file: ${{ inputs.version }}/${{ inputs.variant }}/Dockerfile
83+
labels: ${{ steps.meta.outputs.labels }}
84+
no-cache: ${{ ! inputs.build-cache }}
85+
outputs: type=image,name=${{ inputs.image }},push-by-digest=true,name-canonical=true,push=true
86+
platforms: ${{ matrix.builder.platform }}
87+
88+
- name: Export digest
89+
run: |
90+
mkdir -p ${{ runner.temp }}/digests
91+
digest="${{ steps.build.outputs.digest }}"
92+
touch "${{ runner.temp }}/digests/${digest#sha256:}"
93+
94+
- name: Upload digest
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: digests-${{ inputs.version }}-${{ inputs.variant }}-${{ env.PLATFORM_PAIR }}
98+
path: ${{ runner.temp }}/digests/*
99+
if-no-files-found: error
100+
retention-days: 1
101+
102+
merge:
103+
runs-on: ubuntu-latest
104+
needs:
105+
- build
106+
steps:
107+
- name: Download digests
108+
uses: actions/download-artifact@v4
109+
with:
110+
path: ${{ runner.temp }}/digests
111+
pattern: digests-${{ inputs.version }}-${{ inputs.variant }}-*
112+
merge-multiple: true
113+
114+
- name: Set up Docker Buildx
115+
uses: docker/setup-buildx-action@v3
116+
117+
- name: Docker meta
118+
id: meta
119+
uses: docker/metadata-action@v5
120+
with:
121+
images: |
122+
${{ inputs.image }}
123+
tags: |
124+
${{ inputs.tags }}
125+
126+
- name: Login to Docker registry
127+
uses: docker/login-action@v3
128+
with:
129+
username: ${{ inputs.username }}
130+
password: ${{ secrets.password }}
131+
132+
- name: Create manifest list and push
133+
working-directory: ${{ runner.temp }}/digests
134+
run: |
135+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
136+
$(printf '${{ inputs.image }}@sha256:%s ' *)
137+
138+
- name: Inspect image
139+
run: |
140+
docker buildx imagetools inspect ${{ inputs.image }}:${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)