diff --git a/.gitignore b/.gitignore index a5b6ec9..d3f1891 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__/ # build output site/ +public/ # editor .vscode/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2362433 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,25 @@ +# GitLab Pages: build the MkDocs site and publish to GitLab Pages. +# Triggered on every push to the default branch. +# +# Requirements on the GitLab project: +# - GitLab Pages enabled (Settings → Pages). +# - The default branch matches the `rules:` clause below (main). + +image: python:3.11-slim + +stages: + - build + +pages: + stage: build + before_script: + - pip install --quiet --upgrade pip + - pip install --quiet -r requirements.txt + script: + # GitLab Pages requires the published directory to be named `public/`. + - mkdocs build --strict --site-dir public + artifacts: + paths: + - public + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH diff --git a/README.md b/README.md index 4a94aea..d880c56 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,16 @@ git remote add origin git push -u origin main ``` -Once the repo lives at a GitHub URL with Pages enabled (Settings → Pages -→ Source: GitHub Actions), the workflow at `.github/workflows/publish.yml` -will build and deploy the static site on every push to `main`. +CI configs are included for both hosts — push to whichever you use: + +- **GitLab:** `.gitlab-ci.yml` builds and publishes to GitLab Pages + on every push to the default branch. Enable Pages in + *Project → Settings → Pages*. +- **GitHub:** `.github/workflows/publish.yml` builds and publishes to + GitHub Pages. Enable in *Settings → Pages → Source: GitHub Actions*. + +The unused config can stay — it's harmless and keeps the wiki portable +between hosts. ## Out-of-scope