diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 15d66f0..309888e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,12 +6,25 @@ before_script: pages: stage: deploy script: - - ikiwiki --setup ikiwiki.setup - - echo "Pages accessible through ${CI_PAGES_URL}/${CI_COMMIT_BRANCH}" + - ikiwiki --setup ikiwiki.setup + - echo "Pages accessible through ${CI_PAGES_URL}/${PAGES_PREFIX}" + variables: + PAGES_PREFIX: "" # no prefix by default (master) + pages: + path_prefix: "$PAGES_PREFIX" + environment: + name: "Pages ${PAGES_PREFIX}" + url: "${CI_PAGES_URL}/${PAGES_PREFIX}" artifacts: paths: - public - pages: - path_prefix: "$CI_COMMIT_BRANCH" + rules: + - if: $CI_COMMIT_BRANCH == "staging" # ensure to run on master (with default PAGES_PREFIX) + variables: + PAGES_PREFIX: '_stg' # prefix with _stg for the staging branch + - if: $CI_PIPELINE_SOURCE == "merge_request_event" # conditionally change the prefix on Merge Requests + when: manual # run pages manually on Merge Requests + variables: + PAGES_PREFIX: 'mr$CI_MERGE_REQUEST_IID' # prefix with the mr, like `mr123` tags: - knit diff --git a/test b/test deleted file mode 100644 index e69de29..0000000