feat: build multiplatform images #11
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
name: Build Docker | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- '**' | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- id: pre-step | |
shell: bash | |
run: echo "image-tag=$(git describe --tags --always)" >> $GITHUB_OUTPUT | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build & Publish Docker Image | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
with: | |
name: ${{ github.repository }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ghcr.io | |
platforms: linux/amd64,linux/arm64 | |
tags: "${{ github.ref == 'refs/heads/main' && 'latest,' || '' }}${{ steps.pre-step.outputs.image-tag }}" | |
no_push: ${{ github.event_name == 'pull_request' }} |