fuzzyworld

nordic-skating / commit

ci: test, build and publish the default branch to GitLab Pages

6d112625b1d1356cbff06360af24e05a59f6a15e · Pavel Safronov · 2026-10-08 23:00:03 -0700 · parents c90277fa1447

Claude Code usage: this commit ≈0 out / ≈0 cached · cost unknown (no per-model trailer) · session 1 tally 110 in / 44.4K out / 2.5M cached · usage by commit and session

ci: test, build and publish the default branch to GitLab Pages

Usage: 110 in / 44.4K out / 2.5M cached (session tally)
rtk:   1.8M saved, 25.6% over 2797 cmds (global/lifetime)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
 .gitlab-ci.yml | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..c99b0b7
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,25 @@
+image: node:22
+
+stages: [test, deploy]
+
+test:
+  stage: test
+  script:
+    - npm ci
+    - npm test
+    - npm run build
+
+pages:
+  stage: deploy
+  script:
+    - npm ci
+    - npm run build
+    # GitLab Pages requires the artifact to be a directory named `public`. There is no
+    # `public/` in the repository (vite.config.ts), so this is a rename, not a nest.
+    - mv dist public
+    # Fail loudly rather than publishing a 404.
+    - test -f public/index.html || (echo "no index.html at artifact root" && exit 1)
+  artifacts:
+    paths: [public]
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH