From 95c647c6c725a55f503a05c4096fd35ef90796eb Mon Sep 17 00:00:00 2001 From: Chris Coley <chris@codingallnight.com> Date: Sun, 23 Apr 2023 01:37:00 -0700 Subject: [PATCH] Add support for branch subdirectories --- .gitlab-ci.yml | 11 +++++++---- {public => src}/index.html | 2 +- {public => src}/style.css | 0 3 files changed, 8 insertions(+), 5 deletions(-) rename {public => src}/index.html (94%) rename {public => src}/style.css (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 313b5c4..e8a4e07 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,16 @@ image: alpine:latest +workflow: + rules: + - if: $CI_COMMIT_BRANCH + pages: stage: deploy tags: - docker script: - - echo 'Nothing to do...' + - mkdir -p public/$CI_COMMIT_BRANCH + - cp -r src/* public/$CI_COMMIT_BRANCH artifacts: paths: - - public - only: - - master + - public/$CI_COMMIT_BRANCH diff --git a/public/index.html b/src/index.html similarity index 94% rename from public/index.html rename to src/index.html index 6652c7d..1f9332b 100644 --- a/public/index.html +++ b/src/index.html @@ -13,7 +13,7 @@ <a href="https://gitlab.com/pages/">Other Examples</a> </div> - <h1>Hello World!</h1> + <h1>Hello World! Dev Branch</h1> <p> This is a simple plain-HTML website on GitLab Pages, without any fancy static site generator. diff --git a/public/style.css b/src/style.css similarity index 100% rename from public/style.css rename to src/style.css -- GitLab