Files
DenozordecandClaude Opus 5.5 3f917c6bd2 Hub stage 4: its own image and pipeline
docker/Dockerfile.hub builds the console and ships it with the hub sources on
node:22-alpine, without node_modules, as a non-root user with a healthcheck.
.gitea/workflows/hub.yaml checks and pushes git.shx.one/denozord/technitium-hub
(latest from main, sha-*, X.Y.Z and X.Y from hub-v tags), independent of the console
pipeline, which now ignores hub-only changes. Compose example for hub.shnt.top and
hub/README.md, with the read-only permissions each server's token needs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 19:21:59 +07:00

89 lines
2.5 KiB
YAML

name: CI
on:
push:
branches: [main]
tags: ['v*']
# The hub has its own pipeline (hub.yaml): a change that only touches it does
# not rebuild the console.
paths-ignore:
- 'hub/**'
- 'docker/Dockerfile.hub'
- '.gitea/workflows/hub.yaml'
- 'docs/compose.hub.example.yaml'
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ci-${{ gitea.workflow }}-${{ gitea.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
- run: npm ci
# The console goes in front of a DNS server, so a build that fails its own
# checks must not exist.
- run: npm run typecheck
- run: npm run lint
- run: npm run lint:language
- run: npm run lint:colours
- run: npm run lint:dashes
- run: npm test
- run: npm run build
- name: Routes emitted
run: |
echo "Routes emitted $(find dist -name index.html | wc -l)"
image:
needs: check
if: gitea.event_name != 'pull_request' && (gitea.ref_name == 'main' || startsWith(gitea.ref, 'refs/tags/v'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: git.shx.one
username: ${{ gitea.actor }}
password: ${{ secrets.ACTION_PAT || secrets.ACTIONS_PAT }}
# Registry names are lowercase.
- name: Resolve image name
id: image
run: |
echo "name=git.shx.one/$(echo '${{ gitea.repository }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.image.outputs.name }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ gitea.ref_name == 'main' }}
type=sha,prefix=sha-,enable=${{ gitea.ref_name == 'main' }}
- uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile.gitea
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ steps.image.outputs.name }}:buildcache
cache-to: type=registry,ref=${{ steps.image.outputs.name }}:buildcache,mode=max