Publish docker image to github packages

This commit is contained in:
2025-08-04 21:21:02 +10:00
parent 85ed1c3ebc
commit 75c02f4032
2 changed files with 13 additions and 7 deletions
+12 -6
View File
@@ -70,19 +70,20 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
if: github.event_name == 'release'
- name: Log in to GitHub Container Registry
if: github.event_name == 'push' || github.event_name == 'release'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
passkey-auth
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
@@ -90,13 +91,18 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
labels: |
org.opencontainers.image.title=Passkey Auth
org.opencontainers.image.description=WebAuthn/Passkey authentication server with admin approval workflow
org.opencontainers.image.licenses=Apache-2.0
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'release' }}
push: ${{ github.event_name == 'push' || github.event_name == 'release' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
+1 -1
View File
@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.21-bullseye AS builder
FROM golang:1.23-bullseye AS builder
# Install build dependencies including sqlite
RUN apt-get update && apt-get install -y gcc libsqlite3-dev && rm -rf /var/lib/apt/lists/*