Move the dashboard and setup pages to a Vue SPA
The pages are now a Vue 3 + Vite + TypeScript app in web/, built into internal/web/dist/app and embedded in the binary. Go still serves index.html for / and /setup behind the admin gate, plus the hashed /assets/* (public, cached forever). The router takes its base from the current URL, so it works under nginx's /tracker/ prefix unchanged. Only dist/.gitkeep is committed, so go build and go test need no Node; an unbuilt binary shows a "run make web" page at /. The Dockerfile gains a Node stage, CI typechecks and builds the app, and make build/run build it first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
#
|
||||
# TWO JOBS
|
||||
# test go vet + go test, as `make test`. The API tests skip themselves
|
||||
# here: they need TEST_DATABASE_URL, and CI has no Postgres.
|
||||
# here: they need TEST_DATABASE_URL, and CI has no Postgres. Then
|
||||
# the Vue app's typecheck and build, in a node container.
|
||||
# publish main only, after test: builds deploy/Dockerfile, pushes it to
|
||||
# this Gitea's container registry as :<sha> and :latest, then
|
||||
# pulls it into the web_server stack (its `activity-tracker`
|
||||
@@ -63,6 +64,18 @@ jobs:
|
||||
golang:1.27 \
|
||||
sh -c 'go vet ./... && go test ./...'
|
||||
|
||||
# Copies web/ out of the read-only source so node_modules and the
|
||||
# build output stay in the container.
|
||||
- name: Web - typecheck and build
|
||||
shell: bash
|
||||
run: |
|
||||
set -eu
|
||||
docker run --rm \
|
||||
-v "$SRC":/src:ro \
|
||||
-v activity_tracker_ci_npm:/root/.npm \
|
||||
node:24-alpine \
|
||||
sh -c 'cp -r /src/web /web && cd /web && npm ci && npm run typecheck && npx vite build --outDir /tmp/dist'
|
||||
|
||||
- name: Remove the scratch directory
|
||||
if: always()
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user