2026-06-25 10:04:59 -04:00
|
|
|
name: Build & Push Images
|
|
|
|
|
|
|
|
|
|
# Builds the frontend + backend Docker images and pushes them to the Forgejo
|
2026-06-25 10:55:15 -04:00
|
|
|
# container registry (registry.snsnetlabs.com/sam/...). Runs on every push to
|
2026-06-25 10:04:59 -04:00
|
|
|
# main, and on-demand via the "Run workflow" button (workflow_dispatch).
|
|
|
|
|
#
|
2026-06-25 10:55:15 -04:00
|
|
|
# NOTE: registry.snsnetlabs.com is the unproxied (DNS-only) registry host so
|
|
|
|
|
# large layers bypass Cloudflare's body cap. The web UI / packages list stays
|
|
|
|
|
# on forgejo.snsnetlabs.com (Cloudflare Access SSO).
|
|
|
|
|
#
|
2026-06-25 10:04:59 -04:00
|
|
|
# Requirements (see deploy/README.md):
|
|
|
|
|
# - Forgejo Actions secret FORGEJO_REGISTRY_TOKEN: a package-scoped token for
|
|
|
|
|
# user `sam`.
|
|
|
|
|
# - The runner must allow Docker builds: container.docker_host = "automount"
|
|
|
|
|
# in the forgejo-runner config (mounts /var/run/docker.sock into the job).
|
|
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches: [main]
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
|
|
env:
|
2026-06-25 10:55:15 -04:00
|
|
|
REGISTRY: registry.snsnetlabs.com
|
2026-06-25 10:04:59 -04:00
|
|
|
OWNER: sam
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: Install Docker CLI
|
|
|
|
|
run: |
|
|
|
|
|
apt-get update
|
|
|
|
|
apt-get install -y --no-install-recommends docker.io
|
|
|
|
|
docker version
|
|
|
|
|
|
|
|
|
|
- name: Log in to Forgejo registry
|
|
|
|
|
run: |
|
|
|
|
|
echo "${{ secrets.FORGEJO_REGISTRY_TOKEN }}" \
|
|
|
|
|
| docker login "$REGISTRY" -u "$OWNER" --password-stdin
|
|
|
|
|
|
|
|
|
|
- name: Build & push frontend image
|
|
|
|
|
run: |
|
|
|
|
|
docker build \
|
|
|
|
|
-t "$REGISTRY/$OWNER/archnest:${{ github.sha }}" \
|
|
|
|
|
-t "$REGISTRY/$OWNER/archnest:latest" \
|
|
|
|
|
-f Dockerfile .
|
|
|
|
|
docker push "$REGISTRY/$OWNER/archnest:${{ github.sha }}"
|
|
|
|
|
docker push "$REGISTRY/$OWNER/archnest:latest"
|
|
|
|
|
|
|
|
|
|
- name: Build & push backend image
|
|
|
|
|
run: |
|
|
|
|
|
docker build \
|
|
|
|
|
-t "$REGISTRY/$OWNER/archnest-backend:${{ github.sha }}" \
|
|
|
|
|
-t "$REGISTRY/$OWNER/archnest-backend:latest" \
|
|
|
|
|
-f backend/Dockerfile backend
|
|
|
|
|
docker push "$REGISTRY/$OWNER/archnest-backend:${{ github.sha }}"
|
|
|
|
|
docker push "$REGISTRY/$OWNER/archnest-backend:latest"
|
|
|
|
|
|
|
|
|
|
- name: Log out
|
|
|
|
|
if: always()
|
|
|
|
|
run: docker logout "$REGISTRY"
|