release.yaml:
- Build and push kalekber/libnovel-pocketbase image on every release tag
- Add deploy job (runs after docker): copies docker-compose.yml from the
tagged commit to /opt/libnovel on prod, pulls new images, restarts
changed services with --remove-orphans (cleans up removed pb-init)
ci.yaml:
- Validate cmd/pocketbase builds on every branch push
Required new Gitea secrets: PROD_HOST, PROD_USER, PROD_SSH_KEY,
PROD_SSH_KNOWN_HOSTS (see deploy job comments for instructions).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
77 lines
1.9 KiB
YAML
77 lines
1.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
tags-ignore:
|
|
- "v*"
|
|
paths:
|
|
- "backend/**"
|
|
- "ui/**"
|
|
- ".gitea/workflows/ci.yaml"
|
|
|
|
concurrency:
|
|
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# ── Go: vet + build + test ────────────────────────────────────────────────
|
|
backend:
|
|
name: Backend
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: backend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: backend/go.mod
|
|
cache-dependency-path: backend/go.sum
|
|
|
|
- name: go vet
|
|
run: go vet ./...
|
|
|
|
- name: Build backend
|
|
run: go build -o /dev/null ./cmd/backend
|
|
|
|
- name: Build runner
|
|
run: go build -o /dev/null ./cmd/runner
|
|
|
|
- name: Build healthcheck
|
|
run: go build -o /dev/null ./cmd/healthcheck
|
|
|
|
- name: Build pocketbase
|
|
run: go build -o /dev/null ./cmd/pocketbase
|
|
|
|
- name: Run tests
|
|
run: go test -short -race -count=1 -timeout=60s ./...
|
|
|
|
# ── UI: type-check + build ────────────────────────────────────────────────
|
|
ui:
|
|
name: UI
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ui
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
cache: npm
|
|
cache-dependency-path: ui/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Check Paraglide codegen is up to date
|
|
run: npm run paraglide && git diff --exit-code src/lib/paraglide/
|
|
|
|
- name: Type check
|
|
run: npm run check
|
|
|
|
- name: Build
|
|
run: npm run build
|