Updated when workflows run and fixed issue with the duplicate mount
Container image / image (push) Failing after 10m21s
Container image / image (push) Failing after 10m21s
This commit is contained in:
@@ -1,12 +1,16 @@
|
|||||||
name: Container image
|
name: Container image
|
||||||
|
|
||||||
# Builds the multi-arch container image. On tag push (v*) it logs in
|
# Three modes, all driven by the same job:
|
||||||
# to the Gitea registry on this host and publishes the image as
|
# - Tag push (v*) → full release: :v1.2.3, :1.2, :latest, :sha-<short>
|
||||||
# git.cer.sh/<owner>/<repo>:<version> plus :latest. On pull requests
|
# - Branch push → canary: :<branch>, :sha-<short>
|
||||||
# it builds without pushing — purely a smoke test that the Dockerfile
|
# - Pull request → smoke test: build only, nothing pushed
|
||||||
# still works.
|
#
|
||||||
|
# metadata-action emits the right subset of tags for each event based
|
||||||
|
# on the `tags:` rules below — no manual branching needed.
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -19,16 +23,13 @@ jobs:
|
|||||||
image:
|
image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# The default `ubuntu-latest` label on aether-runner maps to
|
# The default `ubuntu-latest` label on aether-runner maps to
|
||||||
# `node:16-bullseye`, which has no docker CLI — so the docker/*
|
# `node:16-bullseye`, which has no docker CLI. Override to an
|
||||||
# actions fail. Override the job container to catthehacker's
|
# act-compatible image that ships docker + buildx. The runner
|
||||||
# act-compatible image (ships docker CLI + buildx) and mount the
|
# already bind-mounts /var/run/docker.sock into every job
|
||||||
# host's docker socket through. The runner already has the socket
|
# container, so we do NOT add a `volumes:` entry — doing so
|
||||||
# bind-mounted from the host (see docker.yml gitea-runner volume),
|
# produces a duplicate-mount error from the daemon.
|
||||||
# so this exposes that same daemon to the nested job container.
|
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -39,15 +40,27 @@ jobs:
|
|||||||
- name: Set up Buildx
|
- name: Set up Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
# github.repository is owner/name with the repo's original casing;
|
# github.repository is owner/name in the repo's original casing;
|
||||||
# registries require lowercase, so normalise once here and reuse
|
# registries require lowercase. Normalise once and reuse below.
|
||||||
# the result in metadata-action below.
|
|
||||||
- name: Resolve image name
|
- name: Resolve image name
|
||||||
id: img
|
id: img
|
||||||
run: |
|
run: |
|
||||||
repo='${{ github.repository }}'
|
repo='${{ github.repository }}'
|
||||||
echo "ref=git.cer.sh/${repo,,}" >> "$GITHUB_OUTPUT"
|
echo "ref=git.cer.sh/${repo,,}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# Version stamp baked into the binary via -ldflags. Tag pushes
|
||||||
|
# use the tag name directly; everything else gets a short SHA
|
||||||
|
# suffix so `qu version` on a canary build is debuggable.
|
||||||
|
- name: Compute version
|
||||||
|
id: ver
|
||||||
|
run: |
|
||||||
|
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
|
||||||
|
v="${GITHUB_REF_NAME}"
|
||||||
|
else
|
||||||
|
v="${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}"
|
||||||
|
fi
|
||||||
|
echo "version=$v" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Login to Gitea registry
|
- name: Login to Gitea registry
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@@ -65,8 +78,10 @@ jobs:
|
|||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||||
|
type=ref,event=branch
|
||||||
|
type=sha,prefix=sha-,format=short
|
||||||
|
|
||||||
- name: Build (and push on tag)
|
- name: Build (and push on push events)
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@@ -76,7 +91,7 @@ jobs:
|
|||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
build-args: |
|
build-args: |
|
||||||
VERSION=${{ github.ref_name }}
|
VERSION=${{ steps.ver.outputs.version }}
|
||||||
# Inline cache embeds layer metadata into the pushed image
|
# Inline cache embeds layer metadata into the pushed image
|
||||||
# itself — no external cache server needed, which keeps the
|
# itself — no external cache server needed, which keeps the
|
||||||
# workflow self-contained on the Gitea runner.
|
# workflow self-contained on the Gitea runner.
|
||||||
|
|||||||
Reference in New Issue
Block a user