GitHub Pages is one of the many free hosting solutions that exist today. II have chosen to use it simply because I already have a GitHub account and did not want to bother with registering on yet another platform.

0. Setup a github pages repository

Create an empty public repository named yourusername.github.io. This will be the address of your website. It is obligatory to follow this naming rule, otherwise GitHub will not recognize the repository as a GitHub Pages repository.

1. Generate your static website

Once you are happy with how your website looks like locally, you can navigate to the root of your vuepress project and generate your static website by executing the following command

vuepress build docs

2. Commit and push to publish

Now that you have a static website, you can commit it and push it online. To make it work you also need to create an empty .nojekyll file to tell github pages your are note using its Jekyll website generator.

cd /docs/.vuepress/dist
touch .nojekyll
git init
git add -A
git commit -m "Initial commit"
git push -f git@github.com:<yourusername>/<yourusername>.github.io.git master

At this stage, your website should now be online. From now on each time you push a new commit, your website will be automatically updated.

[Optional] 3. Further automation

Sources

https://docs.github.com/en/github/working-with-github-pages/creating-a-github-pages-site