Skip to content

Fix a bunch of bugs (#3) #2

Fix a bunch of bugs (#3)

Fix a bunch of bugs (#3) #2

Workflow file for this run

name: Publish Docker Image to GHCR
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: read
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
call_tests:
uses: ./.github/workflows/tests.yml
build-and-push:
runs-on: ubuntu-latest
needs: call_tests
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Set Fallback Tag (latest)
id: fallback
run: |
if [ -z "${{ steps.meta.outputs.tags }}" ]; then
echo "tags=ghcr.io/${{ github.repository }}:latest" >> $GITHUB_OUTPUT
else
first_tag=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
echo "tags=${first_tag}" >> $GITHUB_OUTPUT
fi
- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.fallback.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false