Skip to content

Deployment

Container image

The frontend ships as a container image published to the GitHub Container Registry (GHCR) at ghcr.io/mcfilu/grinsystem-front. The image is the runtime stage of the Dockerfile — nginx serving Vite's dist/. Both the build and the push reuse the same language-agnostic build-and-push.yml workflow the backend uses (mcfilu/python-reusable-actions), so image building behaves identically across both repos.

  • Every release (cut by release-please) builds and pushes the image, tagged with the release version (e.g. :0.1.0) and :latest. This is the build-and-push job in .github/workflows/merge-main.yml, gated on release_created == 'true'.
  • Every PR builds the runtime target with push: false to catch Dockerfile regressions before they reach main. This is the Docker Build Check job in .github/workflows/pr-checks.yml, which also reports into the PR checks summary table.
  • The image is built for linux/amd64 only — the deploy target is an x86 server, so no multi-arch/QEMU build is performed.
  • Buildx layer caching (type=gha) keeps CI build times reasonable across runs.

Docs site

This documentation site is published to GitHub Pages with mike, which keeps multiple versions side by side and powers the version dropdown in the header. The setup mirrors the backend's docs pipeline.

How versioning works

Deployment is automated by the deploy-docs job in .github/workflows/merge-main.yml, which calls the reusable mike-deploy.yml workflow in mcfilu/node-reusable-actions.

  • Every push to main publishes the in-flight docs under the main version (mike deploy main).
  • Every release (cut by release-please) publishes that version and repoints the latest alias to it (mike deploy --update-aliases <version> latest), then makes latest the default the bare site URL redirects to (mike set-default latest).
  • mike maintains versions.json on the gh-pages branch — this drives the version selector. The selector only appears on the deployed site, never in local mkdocs serve.
  • Aliases (main, latest) are pointers; each deploy repoints them. The gh-pages CNAME file is never touched by mike.

One-time custom-domain setup

The site is served at fe-docs.grintest.pl. This is configured once, outside the repo.

1. Cloudflare DNS (grintest.pl zone)

Add a CNAME record:

Field Value
Type CNAME
Name fe-docs
Target mcfilu.github.io
Proxy status DNS only (grey cloud — not proxied)

2. GitHub Pages (repo settings)

The gh-pages branch is created by the first successful deploy-docs run (i.e. after the first merge to main following this change). Once it exists:

  1. Settings → Pages → Build and deployment → Source: Deploy from a branch → gh-pages / / (root).
  2. Custom domain: set to fe-docs.grintest.pl and save. GitHub writes a CNAME file to the root of gh-pages.
  3. Wait for the DNS check to pass, then tick Enforce HTTPS (Let's Encrypt is provisioned automatically).

mike redeploys never overwrite the root CNAME. If it is ever lost, re-save the custom domain in the Pages settings to restore it.

Local preview

pip install -r docs/requirements.txt
mkdocs serve

Open http://127.0.0.1:8000/. To exercise mike locally without touching the real branch:

mike deploy --branch gh-pages-scratch 0.0.0-test
mike list --branch gh-pages-scratch
git branch -D gh-pages-scratch