Add a simple CI/CD pipeline to the project to automate the building and deployment of the Retype powered website via Gitlab Pages.
- Add a .gitlab-ci.yml file to your repository
- Add a License key to the ENV variables
- Commit a change to the repo to publish the website
Add the following .gitlab-ci.yml file to the project within the root folder.
image: node:latest before_script: - npm install retypeapp --global stages: - deploy pages: stage: deploy script: - retype build --secret $RETYPE_SECRET --output public artifacts: paths: - public/ only: - main
Gitlab will use the latest available node image from the Gitlab Registry and Download & install the latest version of the
retypeapp via npm.
image: node:latest before_script: - npm install retypeapp --global
GitLab Pages will publish your website every time the deploy stage is triggered by a new commit to the repository.
--secret $RETYPE_SECRET is optional.
only: main argument is to ensure the rebuild is only triggered if commit new code is commited to the main branch.
pages: stage: deploy script: - retype build --secret $RETYPE_SECRET --output public artifacts: paths: - public/ only: - main
Commit the .gitlab-ci.yml file and push to the repo.
# Replace [username] and [project] with your values https://gitlab.com/[username]/[project]/-/settings/ci_cd
The variable type must be
standard, plus it is recommended to mask and protect the variable.
After the pipeline finishes successfully, your new generated website will be available online at the following location:
# Replace [username] and [project] with your values https://[username].gitlab.io/[project]/