Last active
February 12, 2023 13:07
-
-
Save ibrahimroshdy/d7b2ec53397841c9bd308000d47bc349 to your computer and use it in GitHub Desktop.
Github workflow runner for Docker Multi-Arch using QEMU, Buildx for amd64 & arm64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Github workflow runner for Docker Multi-Arch using QEMU, Buildx for amd64 & arm64 | |
name: Docker Multi-Arch | |
on: [ push ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: build for amd64/arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Setup hardware emulator using QEMU | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
# Setup Docker Buildx for multi-arch images | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.__YOUR__PERSONAL__GITHUB__TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64, linux/arm64 | |
push: true | |
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment