Skip to content

Commit c4afe31

Browse files
committed
wip(web): add BUILD_GL_PAGES flag for a GitLab Pages-only pipeline
1 parent e426e32 commit c4afe31

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

‎.gitlab-ci.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,34 @@ stages:
3030
- test
3131
- deploy
3232

33+
# Set BUILD_GL_PAGES=true to create a pipeline that only builds and publishes
34+
# GitLab Pages (the jobs in .gitlab-ci/web.yml) — the product includes are
35+
# skipped entirely. See .gitlab-ci/web.yml for usage.
3336
include:
3437
- local: .gitlab-ci/pre-build.yml
38+
rules:
39+
- if: $BUILD_GL_PAGES != "true"
3540
- local: .gitlab-ci/build.yml
41+
rules:
42+
- if: $BUILD_GL_PAGES != "true"
3643
- local: .gitlab-ci/native-build.yml
44+
rules:
45+
- if: $BUILD_GL_PAGES != "true"
3746
- local: .gitlab-ci/image-build.yml
47+
rules:
48+
- if: $BUILD_GL_PAGES != "true"
3849
- local: .gitlab-ci/test.yml
50+
rules:
51+
- if: $BUILD_GL_PAGES != "true"
3952
- local: .gitlab-ci/e2e-test.yml
53+
rules:
54+
- if: $BUILD_GL_PAGES != "true"
4055
- local: .gitlab-ci/image-release.yml
56+
rules:
57+
- if: $BUILD_GL_PAGES != "true"
4158
- local: .gitlab-ci/deploy.yml
59+
rules:
60+
- if: $BUILD_GL_PAGES != "true"
4261
- local: .gitlab-ci/web.yml
4362

4463
workflow:

‎.gitlab-ci/web.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@
88
# publishes to GitLab Pages. Who can view Pages follows the project's
99
# Pages access control (Settings → General → Visibility).
1010
#
11+
# BUILD_GL_PAGES flag: by default these jobs run inside the full product
12+
# pipeline, and "pages" (deploy stage) waits for the earlier stages to
13+
# succeed. Set BUILD_GL_PAGES=true to get a GitLab-Pages-only pipeline
14+
# instead — the product includes are skipped at include level (see
15+
# .gitlab-ci.yml), so Pages builds and publishes without running or waiting on
16+
# the product jobs. Ways to set it:
17+
# - one-off: CI/CD → Pipelines → "New pipeline" → variable BUILD_GL_PAGES=true
18+
# - with push: git push -o ci.variable="BUILD_GL_PAGES=true"
19+
# - permanent: Settings → CI/CD → Variables → BUILD_GL_PAGES=true
20+
# The website build has no dependency on product-job artifacts: it uses the
21+
# committed web/ content plus the catalog API fetch below.
22+
#
1123
# Hugo is installed pinned from GitHub releases instead of using a hugomods
1224
# image: the build also runs web/scripts/fetch-catalog.py, which needs python3,
1325
# and the hugomods images don't guarantee it.
@@ -33,6 +45,7 @@
3345
build web:
3446
extends: .web hugo
3547
stage: test
48+
needs: []
3649
rules:
3750
- changes:
3851
- web/**/*
@@ -48,6 +61,7 @@ build web:
4861
pages:
4962
extends: .web hugo
5063
stage: deploy
64+
needs: []
5165
rules:
5266
- if: $CI_COMMIT_BRANCH == "wip-unified-stackgres-website"
5367
changes:

0 commit comments

Comments
 (0)