My workflow is based on the use of existing GitHub actions, small script for building Styleguide example and hosting results on GitHub Pages.
You can use it for building an example for hosting your own visual documentation / components or static website demo. The same workflow with any react UI library or building tool - Storybook, Styleguidist or any other:)
One of the main benefits - on each push / pull request in main branch of your repo, you will automatically get an up-to-date version of your UI Library or App.
After you perform initial setup, which consists of:
- create your own Personal Access Token on GitHub setting page. Use this access token as the password in code below, not your actual account password.
- setup your GitHub username as USERNAME and remote url as REMOTE_URL (for example https://github.com/winner95/styleguide.git) in GitHub Secrets.
- setup GitHub Pages for your repo.
- create file
.github/workflows/publish-docs.ymlin your repo.
- paste the following code:
Try to push any change to your repo.
Congratulations! You can find the results of your build on GitHub Pages. In my case via this link.
In my case the build take up to 1 minutes with installation of dependencies, which is quite fast.