Skip to content

Commit 7254572

Browse files
committed
feat: add multi-arch support
1 parent cea94c1 commit 7254572

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

.github/workflows/build-docker-image.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ name: Build Docker images
22

33
on:
44
pull_request:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
push:
7-
branches: [ "main" ]
7+
branches: ["main"]
88
tags:
99
- "v*"
1010

1111
jobs:
12-
1312
build:
1413
runs-on: ubuntu-22.04
1514

@@ -18,15 +17,23 @@ jobs:
1817
python-version: ["3.8", "3.9", "3.10", "3.11"]
1918

2019
steps:
21-
- uses: actions/checkout@v3
20+
- name: Check out the repo
21+
uses: actions/checkout@v4
22+
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v3
2225

23-
- name: Build the Docker image
24-
shell: bash
25-
run: |
26-
docker build . \
27-
--file Dockerfile \
28-
--tag python-latex:${{ matrix.python-version }}-$(date +'%Y%m%d%H%M%S') \
29-
--build-arg PYTHON_VERSION=${{ matrix.python-version }}
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Build the Docker image
30+
shell: bash
31+
run: |
32+
docker buildx build . \
33+
--platform linux/amd64,linux/arm64 \
34+
--file Dockerfile \
35+
--tag python-latex:${{ matrix.python-version }}-$(date +'%Y%m%d%H%M%S') \
36+
--build-arg PYTHON_VERSION=${{ matrix.python-version }}
3037
3138
# Creates a GitHub Release when the build job succeeds, and only on pushes to tags.
3239
release:

.github/workflows/publish-docker-image.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,33 @@ jobs:
1717

1818
steps:
1919
- name: Check out the repo
20-
uses: actions/checkout@v3
21-
20+
uses: actions/checkout@v4
21+
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v3
24+
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v3
27+
2228
- name: Log in to Docker Hub
23-
uses: docker/login-action@40891eba8c2bcd1309b07ba8b11232f313e86779
29+
uses: docker/login-action@v3
2430
with:
2531
username: ${{ secrets.DOCKER_USERNAME }}
2632
password: ${{ secrets.DOCKER_PASSWORD }}
2733

2834
- name: Get current timestamp
2935
id: timestamp
3036
run: echo "::set-output name=timestamp::$(date +'%Y-%m-%dT%H:%M:%SZ')"
31-
37+
3238
- name: Get git commit SHA
3339
id: git_sha
3440
run: echo "::set-output name=git_sha::$(git rev-parse HEAD)"
3541

3642
- name: Build and push Docker image
37-
uses: docker/build-push-action@f9efed53cc1b0364ba947400ac02042bbbaac7fc
43+
uses: docker/build-push-action@v5
3844
with:
3945
context: .
46+
platforms: linux/amd64,linux/arm64
4047
push: true
4148
tags: engineervix/python-latex:${{ matrix.python-version }}
4249
labels: |

0 commit comments

Comments
 (0)