Skip to content

Commit 0af1c01

Browse files
authored
Add support to build multi-arch docker images (#1587)
1 parent 9c98b1f commit 0af1c01

File tree

2 files changed

+62
-12
lines changed

2 files changed

+62
-12
lines changed

.github/workflows/dev_deploy.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,41 @@ jobs:
1212
- name: Check out the repo
1313
uses: actions/checkout@v2
1414

15-
- name: Push to Docker Hub
16-
uses: docker/build-push-action@v1
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v1
17+
with:
18+
platforms: all
19+
20+
- name: Docker meta
21+
id: meta
22+
uses: docker/metadata-action@v3
23+
with:
24+
images: |
25+
slatedocs/slate
26+
tags: |
27+
type=ref,event=branch
28+
29+
- name: Set up Docker Buildx
30+
id: buildx
31+
uses: docker/setup-buildx-action@v1
32+
33+
- name: Login to DockerHub
34+
uses: docker/login-action@v1
1735
with:
1836
username: ${{ secrets.DOCKER_USERNAME }}
1937
password: ${{ secrets.DOCKER_ACCESS_KEY }}
20-
repository: slatedocs/slate
21-
tag_with_ref: true
22-
38+
39+
- name: Push to Docker Hub
40+
uses: docker/build-push-action@v2
41+
with:
42+
builder: ${{ steps.buildx.outputs.name }}
43+
context: .
44+
file: ./Dockerfile
45+
platforms: linux/amd64,linux/arm64,linux/ppc64le
46+
push: true
47+
tags: ${{ steps.meta.outputs.tags }}
48+
labels: ${{ steps.meta.outputs.labels }}
49+
2350
deploy_gh:
2451
permissions:
2552
contents: write
@@ -42,13 +69,11 @@ jobs:
4269
restore-keys: |
4370
gems-${{ runner.os }}-${{ env.ruby-version }}-
4471
gems-${{ runner.os }}-
45-
4672
- run: bundle config set deployment 'true'
4773
- name: bundle install
4874
run: |
4975
bundle config path vendor/bundle
5076
bundle install --jobs 4 --retry 3
51-
5277
- run: bundle exec middleman build
5378

5479
- name: Deploy

.github/workflows/publish.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,36 @@ jobs:
1212
- name: Check out the repo
1313
uses: actions/checkout@v2
1414

15-
- name: Push to Docker Hub
16-
uses: docker/build-push-action@v1
15+
- name: Set up QEMU
16+
uses: docker/setup-qemu-action@v1
17+
with:
18+
platforms: all
19+
20+
- name: Docker meta
21+
id: meta
22+
uses: docker/metadata-action@v3
23+
with:
24+
images: slatedocs/slate
25+
tags: |
26+
type=ref,event=tag
27+
28+
- name: Set up Docker Buildx
29+
id: buildx
30+
uses: docker/setup-buildx-action@v1
31+
32+
- name: Login to DockerHub
33+
uses: docker/login-action@v1
1734
with:
1835
username: ${{ secrets.DOCKER_USERNAME }}
1936
password: ${{ secrets.DOCKER_ACCESS_KEY }}
20-
repository: slatedocs/slate
21-
tag_with_ref: true
22-
tags: latest
37+
38+
- name: Push to Docker Hub
39+
uses: docker/build-push-action@v2
40+
with:
41+
builder: ${{ steps.buildx.outputs.name }}
42+
context: .
43+
file: ./Dockerfile
44+
platforms: linux/amd64,linux/arm64,linux/ppc64le
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)