The runner no longer has a Docker daemon (it gave every workflow root on the server), and this workflow never worked anyway: it logged in to gitea:3000, which the daemon couldn't resolve. Log in to git.thesatelliteoflove.com and build through the BuildKit socket instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.3 KiB
YAML
40 lines
1.3 KiB
YAML
# Gitea Actions workflow for StarPunk
|
|
# Builds and pushes container images on version tags.
|
|
#
|
|
# The runner has no Docker daemon (that would give workflows root on the
|
|
# server). Images are built by the rootless BuildKit container next to it,
|
|
# reached through its socket.
|
|
name: Build Container
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
REGISTRY: git.thesatelliteoflove.com
|
|
BUILDKIT: unix:///run/buildkit/buildkit/buildkitd.sock
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Install dependencies
|
|
run: apk add --no-cache nodejs git docker-cli docker-cli-buildx
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Log in to the Gitea registry
|
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login "$REGISTRY" -u "${{ github.actor }}" --password-stdin
|
|
- name: Use the BuildKit socket
|
|
run: docker buildx create --name ci --driver remote "$BUILDKIT" --use
|
|
- name: Build and push
|
|
run: |
|
|
image="$REGISTRY/$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')"
|
|
docker buildx build --push -f Containerfile \
|
|
-t "$image:${{ github.ref_name }}" -t "$image:latest" .
|
|
- name: Clean up
|
|
if: always()
|
|
run: |
|
|
docker buildx rm ci || true
|
|
docker logout "$REGISTRY" || true
|