caf98ed6a9
Publish container / publish (push) Successful in 48s
QEMU cross-arch emulation hung indefinitely on the self-hosted Gitea runner (likely no privileged Docker access), so the actual arch wasn't the problem worth chasing. The far more common cause of "no matching manifest" against a self-hosted registry is Buildx's default provenance/SBOM attestation manifests, which not every registry implementation (including Gitea's) resolves correctly when a client requests a single-platform pull. Disabling both keeps the image a plain single-manifest image, matching what a manual `docker push` already produced and pulled fine.
64 lines
1.9 KiB
YAML
64 lines
1.9 KiB
YAML
name: Publish container
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Determine target registry
|
|
id: registry
|
|
run: |
|
|
if [ "${{ github.server_url }}" = "https://github.com" ]; then
|
|
echo "registry=ghcr.io" >> "$GITHUB_OUTPUT"
|
|
echo "image=ghcr.io/mfwadejr/vboxstock" >> "$GITHUB_OUTPUT"
|
|
else
|
|
host="$(printf '%s' '${{ github.server_url }}' | sed -E 's#^https?://##')"
|
|
echo "registry=$host" >> "$GITHUB_OUTPUT"
|
|
echo "image=$host/marvin/vboxstock" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Set up Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Sign in to container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ steps.registry.outputs.registry }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ github.server_url == 'https://github.com' && secrets.GITHUB_TOKEN || secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Generate image tags
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ steps.registry.outputs.image }}
|
|
tags: |
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
type=ref,event=tag
|
|
type=sha
|
|
|
|
- name: Build and publish image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
provenance: false
|
|
sbom: false
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
GIT_SHA=${{ github.sha }}
|
|
BUILD_DATE=${{ github.event.repository.updated_at || github.run_id }}
|