From 7019ab32cc838e8fc5022bdbcaadd1f71689466e Mon Sep 17 00:00:00 2001 From: Chris Coley <chris@codingallnight.com> Date: Sun, 23 Apr 2023 03:10:19 -0700 Subject: [PATCH 1/3] Update the pipeline badge in the README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a36586..0ca0a70 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ - +[](https://git.codingallnight.com/chris/pages-test/-/commits/master) --- -Example plain HTML site using GitLab Pages. +Example plain HTML site using GitLab Pages and Environments. Learn more about GitLab Pages at https://pages.gitlab.io and the official documentation https://docs.gitlab.com/ce/user/project/pages/. -- GitLab From 37c96e8e237da8835206f4911ef6c51c1931c1e6 Mon Sep 17 00:00:00 2001 From: Chris Coley <chris@codingallnight.com> Date: Sun, 23 Apr 2023 03:15:22 -0700 Subject: [PATCH 2/3] Fix the review CI job --- .gitlab-ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 847812d..877a0e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,23 +14,22 @@ workflow: stage: deploy tags: - docker - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - when: never script: - sed -i "s/%%BRANCH%%/$CI_COMMIT_BRANCH/g" src/index.html - mv src public artifacts: paths: - public/ - environment: - name: review/$CI_COMMIT_BRANCH - url: "https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html" # Deploy a review environment for any push to a branch that is not the default # branch review: extends: .deploy + rules: + - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH + environment: + name: review/$CI_COMMIT_BRANCH + url: "https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html" # Deploy to GitLab Pages for pushes on the default branch pages: -- GitLab From 7584daef9b09da794ebe1e4a2106a6b73084a3d0 Mon Sep 17 00:00:00 2001 From: Chris Coley <chris@codingallnight.com> Date: Sun, 23 Apr 2023 03:21:49 -0700 Subject: [PATCH 3/3] Remove the slash from review environment names to prevent directory collapsing in the UI --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 877a0e3..283c21c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,7 +28,7 @@ review: rules: - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH environment: - name: review/$CI_COMMIT_BRANCH + name: "review $CI_COMMIT_BRANCH" url: "https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html" # Deploy to GitLab Pages for pushes on the default branch -- GitLab