Skip to content

Commit

Permalink
chore: github actions: support multi-arch build and push.
Browse files Browse the repository at this point in the history
  • Loading branch information
andyhan committed Jan 10, 2024
1 parent 43091de commit 99aff44
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ jobs:

steps:
- name: Check Out Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Inspect builder
run: |
Expand All @@ -47,28 +47,28 @@ jobs:
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Login to the Github Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to My Gitea Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ secrets.GITEA_SERVER }}
username: ${{ secrets.GITEA_USERNAME }}
password: ${{ secrets.GITEA_ACCESS_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
docker.io/${{ github.repository }}
Expand All @@ -79,12 +79,12 @@ jobs:
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
Expand Down

0 comments on commit 99aff44

Please sign in to comment.