1

I've been creating gitlab pages with the .gitlab-ci.yml template file:

# This file is a template, and might need editing before it works on your project.
# Full project: https://gitlab.com/user/project
pages:
  stage: deploy
  script:
  - mkdir .public
  - cp -r * .public
  - mv .public public
  artifacts:
    paths:
    - public
  only:
  - master

So far so good, it runs the index.html file on repo root.

The problem: I have a repo where the production files are on dist/ folder.

How do I change the deploy to read the files on that folder instead of reading the root ?

tree

- /src
- /dist 
---- index.html ---> i want to set this as root
---- assets/ 
.gitignore
README.md
gulpfile.js
package.json

----> gitlab is trying to find index.html on the root
sandrina-p
  • 3,794
  • 8
  • 32
  • 60

1 Answers1

2

You cant do it directly but you can use the following trick/hack:

html has the following meta tag:

<meta http-equiv="refresh" content="0;url=http://repo.github.io/folder/index.html" />

commit this as your index.html and it will redirect the index page to any inner file you want inside your local gh-pages branch.

The http-equiv="refresh" will redirect the page to any desired location you want.

CodeWizard
  • 128,036
  • 21
  • 144
  • 167