Add the website: Go server + Vue SPA in site/, with CI
A standalone container for web_server, shaped like job-tracker: serves /usaco/ with solved problems public and solving/skipped plus edits (status, link, notes) for the site admin. Git is the only store: the server clones adamf/usaco from Gitea, pulls on the push webhook, and commits edits back. CI builds the image only when site/ changes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# =============================================================================
|
||||
# Makefile — the commands that verify and run the site. `make check` is the
|
||||
# thing to run before pushing; .gitea/workflows/ci.yaml (at the repo root)
|
||||
# runs the same checks in containers before it publishes an image.
|
||||
#
|
||||
# Needs on the host: Go (the version in go.mod) for check-go, Node with
|
||||
# `npm install` done in web/ for check-web, Docker for dev.
|
||||
# =============================================================================
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
.PHONY: help check check-go check-web dev
|
||||
|
||||
help:
|
||||
@echo "Targets:"
|
||||
@echo " make check run every check below"
|
||||
@echo " make check-go go vet + go test"
|
||||
@echo " make check-web vite build of web/ into a throwaway directory"
|
||||
@echo " make dev build and run the standalone site (http://localhost:8080/usaco/)"
|
||||
|
||||
check: check-go check-web
|
||||
|
||||
check-go:
|
||||
go vet ./... && go test ./...
|
||||
|
||||
# Built into a temporary directory so a check never replaces web/dist.
|
||||
check-web:
|
||||
cd web && npx vite build --outDir "$$(mktemp -d)" --emptyOutDir
|
||||
|
||||
dev:
|
||||
docker compose up --build
|
||||
Reference in New Issue
Block a user