Skip to content

Commit

Permalink
ci: Build Docker for arm64 arch
Browse files Browse the repository at this point in the history
- Trivial upgrades:
  - docker/build-push-action@v5 => v6
  • Loading branch information
mathix420 committed Aug 24, 2024
1 parent b5c2cb8 commit 3b7579d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ on:
ref:
required: true
type: string
workflow_dispatch:
inputs:
ref:
description: The ref to build from.
required: true
type: string

# By default, run all commands in a bash shell. On Windows, the default would
# otherwise be powershell.
Expand All @@ -32,6 +38,11 @@ jobs:
ref: ${{ inputs.ref }}
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Build
shell: bash
run: docker buildx build .
run: docker buildx build --platform linux/amd64,linux/arm64 .
11 changes: 9 additions & 2 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,38 @@ jobs:
submodules: recursive
fetch-tags: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_CI_USERNAME }}
password: ${{ secrets.DOCKERHUB_CI_TOKEN }}

- name: Push to Docker Hub
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
# Important: use actions/checkout source, which has the right tags!
# Without context: ., this action will try to fetch git source
# itself, and it will be unable to determine the correct version
# number.
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKERHUB_PACKAGE_NAME }}:${{ inputs.tag }}

- name: Push to Docker Hub as "latest"
if: ${{ inputs.latest }}
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
# Important: use actions/checkout source, which has the right tags!
# Without context: ., this action will try to fetch git source
# itself, and it will be unable to determine the correct version
# number.
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKERHUB_PACKAGE_NAME }}:latest

0 comments on commit 3b7579d

Please sign in to comment.