Creating a GitLab project
To keep organized, I use different branches branches:
mainfor everything - the branch of it all.
blogfor blog posts (adding new ones, updating existing ones, and fixing typos).
contentfor website content (updating the about page and adding new projects).
designfor design and frontend stuff (changing fonts and colors).
featuresfor different features (adding Vale or a contact form).
pagesfor configuring GitLab pages for deploying the website.
Deploying Docusaurus with GitLab Pages
- In the project root directory, I created a new file
gitlab-ci.ymlfile, I used the following configuration:
image: node:15.12-alpine3.13 stages: - deploy pages: stage: deploy script: - npm install - npm run build - mv ./build ./public artifacts: paths: - public only: - main
only: mainmeans that the script will run only for changes made in the main branch. If I wanted to run the pipeline for other branches, I’d add the names of the respective branches.
- In the
- Access the page: