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

Commit

Permalink
chore: build image for all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
clement2026 committed Sep 21, 2023
1 parent 3a6a894 commit a730116
Showing 1 changed file with 3 additions and 37 deletions.
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 }}

0 comments on commit a730116

Please sign in to comment.