This question is about how to deploy multiple reveal.js presentations on GitLab pages, originating from one repository.
I'm quite new to reveal.js and playing around with integration to GitLab, deploying a presentation to GitLab pages. In my repo, I'm hosting my themes and presentations (all in one repo). I can deploy one presentation from one branch. Next goal is to host all/multiple (public) presentations at the same time with GitLab pages.
/2020/pres1
and /2020/pres2
. (Setup was adapted from Elmiko ).In the first presentation branch, a .gitlab-ci.yml
file is sitting, which is deploying the first presentation to username.gitlab.io/repo-name/
This is working fine.
.gitlab-ci.yml
:
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- 2020/pres1
pres2
it the 2020/pres2
branch would 'overwrite' the deployed first page.What alterations have to be made on the yml files to achieve the following result?
username.gitlab.io/repo-name/year/branch
.username.gitlab.io/repo-name/2020/pres1
andusername.gitlab.io/repo-name/2020/pres2
Thanks in advance for your advice.
With some trail and error, I came up with the following solution:
cache:
paths:
- public
pages:
stage: deploy
script:
- mkdir .build
- cp -r * .build/
- mkdir -p public/$CI_COMMIT_BRANCH/
- rm -r public/$CI_COMMIT_BRANCH/* # do delete possible stuff from old build
- mv .build/* public/$CI_COMMIT_BRANCH/
artifacts:
name: "$CI_COMMIT_BRANCH"
paths:
- public
This post helped to develop the solution shown.
Comments on possible flaws of this solution are appreciated. Not sure if it is a problem that the only
statement was removed.