Files
Archivum/.gitea/workflows/build.yaml
Bjorn Blomberg 0fa8f951ae
All checks were successful
build-and-push / build (push) Successful in 1m54s
ci: rebuild trigger 3 (transient TLS-timeout mot docker.io i run #8)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 22:56:21 +02:00

42 lines
1.6 KiB
YAML

name: build-and-push
# Bygger Archivum-imagen på Pi5-runnern (arm64, nativt) och pushar till den lokala
# registryn. Ett enda multi-stage-bygge (frontend -> backend -> runtime), så
# build-context måste vara repo-roten (Dockerfile COPY:ar frontend/, backend/ och
# docker/entrypoint.sh). localhost:5000 trustas automatiskt av Docker på Pi5
# (ingen insecure-registry-config behövs där).
#
# Pull:a på Pi5 med localhost:5000/archivum:latest (t.ex. i dockge-stacken).
# rebuild trigger: 3 (run #8 hit a transient TLS timeout pulling alpine:3.20)
on:
push:
branches: [main, master]
paths:
- "backend/**"
- "frontend/**"
- "docker/**"
- ".gitea/workflows/build.yaml"
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build & push image
# The runner builds on the Pi5 next to live services. BUILD_CPUS caps the
# CPU-heavy build tools (Go compiler + esbuild) to 2 of 4 cores so the box
# stays responsive; nice/ionice further deprioritise the client-side work.
# Slower build, but nginx/NPM and the other containers keep serving.
run: |
nice -n 19 ionice -c 3 docker build --progress=plain \
--build-arg BUILD_CPUS=2 \
-f docker/Dockerfile \
-t localhost:5000/archivum:latest \
-t "localhost:5000/archivum:${GITHUB_SHA::12}" \
.
docker push localhost:5000/archivum:latest
docker push "localhost:5000/archivum:${GITHUB_SHA::12}"