(assuming project is hosted on GitLab)
- Enable shared runners by going to "Settings" > "Runners".
- Add
.gitlab-ci.yml
with the following content:
image: node:6.9.1
pages:
artifacts:
paths:
- build
cache:
paths:
- .yarn-cache/
only:
- master
script:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.19.1
- export PATH="$HOME/.yarn/bin:$PATH"
- yarn config set cache-folder $(pwd)/.yarn-cache
- yarn install
- yarn build
stage: deploy
Your website will be available at https://username.gitlab.io/projectname
.
If you want the URL to look like https://username.gitlab.io
, go to
your project's Settings and rename your project to username.gitlab.io
.
To learn more about GitLab Pages go to https://pages.gitlab.io (official documentation available at http://doc.gitlab.com/ee/pages/README.html).