Example of how to use Github Actions to build and publish a TiddlyWiki
Once configured, every time you push changes to your repository, an updated TiddlyWiki file will be built and published at a public URL.
Starting point: a wiki folder for TiddlyWiki on node.js, being saved to a Github repository.
In the root of your repository you need to:
- add a
package.jsonfile. You can do so vianpmusingnpm init, or by copying and modifying thepackage.jsonin this repo. - add TiddlyWiki as a dependency
npm install tiddlywiki - Add a script
buildto yourpackage.jsonfile by copying from thepackage.jsonin this repo and modifying it so it corresponds to the command you would need to run in the root of your repository to build the TiddlyWiki. If yourtiddlywiki.infofile is in the repository root directory, you do not need to modify this.- You can verify that everything works so far by running the command
npm run build, the wiki HTML file should be saved in the directoryoutputin the root of your repository. This directory can safely be deleted after testing.
- You can verify that everything works so far by running the command
- In to the root of your repository, copy the
.githubdirectory from this repository. - Add these new files to Git, commit and push to Github.
- The TiddlyWiki will automatically be built and pushed to your
gh-pagesbranch. - If you do not already have Github Pages enabled for your repository, go to the settings page for your repository, choose Pages from the left hand menu. Under "Source" choose the branch "gh-pages" and save.
- Your wiki will be available at https://{username}.github.io/{reponame}, for example for this repo https://saqimtiaz.github.io/TW5-github-actions-example/
- Every time you push changes to your repository, an updated TiddlyWiki file will be built and published at this URL