2026-06-29 21:56:12 -05:00
|
|
|
name: Smoke — Docker Build and Push
|
|
|
|
|
|
2026-06-29 22:03:58 -05:00
|
|
|
# Runs on the `host` label so docker build/push use the runner container's
|
|
|
|
|
# bundled Docker CLI and the mounted /var/run/docker.sock. The `ubuntu-latest`
|
|
|
|
|
# label runs steps inside a node job container that has neither.
|
|
|
|
|
#
|
|
|
|
|
# Requires repo Action secrets:
|
|
|
|
|
# REGISTRY_USER — registry username (e.g. your Gitea user)
|
|
|
|
|
# REGISTRY_TOKEN — a scoped package read/write token (NOT an admin API token)
|
|
|
|
|
|
2026-06-29 21:56:12 -05:00
|
|
|
on:
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
2026-06-29 22:03:58 -05:00
|
|
|
runs-on: host
|
2026-06-29 21:56:12 -05:00
|
|
|
steps:
|
|
|
|
|
- name: Checkout
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
|
with:
|
|
|
|
|
registry: registry.alwisp.com
|
|
|
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
|
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
|
|
|
|
|
|
- name: Build and Push
|
|
|
|
|
run: |
|
2026-06-29 22:03:58 -05:00
|
|
|
# gitea.repository is already "owner/repo" (e.g. jason/forgerunner)
|
|
|
|
|
IMAGE="registry.alwisp.com/${{ gitea.repository }}"
|
2026-06-29 21:56:12 -05:00
|
|
|
docker build \
|
2026-06-29 22:03:58 -05:00
|
|
|
-t "${IMAGE}:latest" \
|
|
|
|
|
-t "${IMAGE}:${{ gitea.sha }}" \
|
2026-06-29 21:56:12 -05:00
|
|
|
-f docker/runner/Dockerfile \
|
|
|
|
|
.
|
2026-06-29 22:03:58 -05:00
|
|
|
docker push "${IMAGE}:latest"
|
|
|
|
|
docker push "${IMAGE}:${{ gitea.sha }}"
|
2026-07-02 09:25:25 -05:00
|
|
|
|
|
|
|
|
# Dangling-only prune: removes untagged leftovers from previous builds.
|
|
|
|
|
# Never removes tagged images (the fresh :latest may be deployed on the
|
|
|
|
|
# host) or any image referenced by a container. See
|
|
|
|
|
# docs/troubleshooting.md "Orphan images piling up on the host".
|
|
|
|
|
- name: Prune dangling images on host
|
|
|
|
|
if: always()
|
|
|
|
|
run: docker image prune -f 2>/dev/null || true
|