Skip to content

add qemu

add qemu #2

Workflow file for this run

name: Publish Docker image
on:
pull_request:
push:
branches: [ "main"]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
env:
COMMIT_SHA: ${{ github.sha }}
IMAGE_URL: "ghcr.io/${{ github.repository }}"
PLATFORMS: "linux/amd64,linux/arm64"
DOCKERFILE_BUILD: "Dockerfile.build"
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image (versioned)
if: github.event_name == 'push'
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: ${{ env.PLATFORMS }}
tags: "${{ env.IMAGE_URL }}:latest-${{ env.COMMIT_SHA }}"
file: ${{ env.DOCKERFILE_BUILD }}
- name: Build and push Docker image (tagged)
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name == 'push' }}
platforms: ${{ env.PLATFORMS }}
tags: "${{ env.IMAGE_URL }}/${{ github.repository }}:latest"
file: ${{ env.DOCKERFILE_BUILD }}