Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

chore: build image for all platforms #42

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 3 additions & 37 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,9 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
amd64:
name: AMD64
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=ref,event=tag

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

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

arm64:
name: ARM64
multi-platforms:
name: multi-platforms
runs-on: ubuntu-latest
steps:
- name: Check out the repo
Expand Down Expand Up @@ -75,7 +41,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/arm64
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}