I have a private repo for which I would like to set up a staging area and have it deploy when pushing to dev
branch.
This is my .gitlab-ci.yml
now
image: alpine:latest
pages:
stage: deploy
script:
- echo 'Nothing to do...'
artifacts:
paths:
- public
only:
- master
review:
stage: deploy
script: |
# Nothing
artifacts:
paths:
- public
environment:
name: Review
url: "https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html"
variables:
PUBLIC_URL: "/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public"
When logged into GitLab I can see the job artifacts at https://$CI_PROJECT_NAMESPACE.gitlab.io/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html
. But logged out / external users can't see this URl. They're redirected to a login page.
The docs seem to indicate this is because the project is set to private: For private projects, to all project members (Guest or higher)
Is there a way to set up a publicly accessible staging area on a private GitLab Pages repo? Or do I have to make the repo public?