Commit 43483427 authored by Kourser's avatar Kourser
Browse files

ci(pages): bootstrap pinned Node via python3 (shell runner ignores image:)

The runner is a shell executor that ignores `image:` and uses an old host
Node (Docusaurus 'Minimum Node.js version not met'), regardless of the tag.
Mirror the old MkDocs pip-bootstrap approach: download a pinned Node 20.20.2
into the workspace with python3, then build. Arch-aware (x64/arm64).

Co-Authored-By: Claude (RCA)
parent b1a1892e
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
# GitLab Pages — Docusaurus multilingual site (see website/).
# The site lives in website/; the build output (website/build) is moved to
# public/ at the repo root for Pages.
#
# NOTE on the image tag: org policy prefers a pinned version, but this runner
# does not honour specific Node tags (a pinned `node:20.20.2` fell back to an
# old system Node → Docusaurus "Minimum Node.js version not met"). Only
# `node:latest` is pulled correctly here. Re-pin to a specific LTS (e.g.
# node:22.x) once the runner/registry can pull exact tags.
image: node:latest
# This project's runner is a SHELL executor (amd64/linux) that IGNORES `image:`
# and runs on the host's (too old) system Node. So — exactly like the old MkDocs
# pipeline bootstrapped pip via python3 — we bootstrap a PINNED Node into the
# workspace with python3 (no image:, no curl/apt/sudo needed, just python3 +
# network to nodejs.org). The build output (website/build) is moved to public/
# at the repo root for Pages.

stages:
  - test
  - deploy

# Cache node_modules across pipelines, keyed by the lockfile.
default:
  cache:
    key:
@@ -21,6 +18,14 @@ default:
        - website/package-lock.json
    paths:
      - website/node_modules/
  before_script:
    # Bootstrap a pinned Node into the workspace (the shell runner ignores `image:`).
    - ARCH=$(uname -m); case "$ARCH" in x86_64) NODE_ARCH=linux-x64 ;; aarch64|arm64) NODE_ARCH=linux-arm64 ;; *) echo "unsupported arch $ARCH"; exit 1 ;; esac
    - NODE_DIST="node-v20.20.2-${NODE_ARCH}"
    - python3 -c "import urllib.request; urllib.request.urlretrieve('https://nodejs.org/dist/v20.20.2/${NODE_DIST}.tar.gz', 'node.tar.gz')"
    - tar -xzf node.tar.gz
    - export PATH="$CI_PROJECT_DIR/${NODE_DIST}/bin:$PATH"
    - node -v && npm -v

# Build check on branches / merge requests (does not publish).
build:
@@ -34,7 +39,7 @@ build:
    - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

# Publish from the default branch, matching the previous MkDocs deploy.
# Publish from the default branch.
pages:
  stage: deploy
  script: