Files
mrp-qrcode/.gitea/workflows/docker-build.yml
T
jason ca96e3461f
Build and Push Docker Image / build (push) Failing after 6s
docker-build.yml: push :latest only + clean up host build images
- drop per-commit :sha tag (registry stays one tag per repo)
- remove the built image and prune dangling layers after push so CI builds
  stop accumulating orphan images on the Unraid host
2026-06-29 23:07:42 -05:00

39 lines
1.2 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
# Runs on the forgerunner host: bundled Docker CLI + mounted /var/run/docker.sock.
runs-on: host
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: |
# gitea.repository is already "owner/repo" (e.g. jason/breedr).
IMAGE="registry.alwisp.com/${{ gitea.repository }}"
docker build -t "${IMAGE}:latest" .
docker push "${IMAGE}:latest"
- name: Clean up build images on host
# Builds use the host Docker daemon, so the built image and replaced
# layers stay on the Unraid host unless removed. Drop our tag and prune
# dangling layers to stop orphan images piling up on the array.
if: always()
run: |
IMAGE="registry.alwisp.com/${{ gitea.repository }}"
docker image rm -f "${IMAGE}:latest" 2>/dev/null || true
docker image prune -f 2>/dev/null || true