├── tiddlers └── SiteTitle.tid ├── .github └── workflows │ └── build.yml ├── package.json ├── LICENSE ├── README.md └── tiddlywiki.info /tiddlers/SiteTitle.tid: -------------------------------------------------------------------------------- 1 | title: $:/SiteTitle 2 | type: text/vnd.tiddlywiki 3 | 4 | Demo wiki -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build TiddlyWiki 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | jobs: 10 | deploy: 11 | runs-on: ubuntu-18.04 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: actions/setup-node@v2-beta 15 | with: 16 | node-version: '16' 17 | 18 | - name: Install Dependency 19 | run: npm install 20 | - name: Build 21 | run: | 22 | npm run build 23 | 24 | - name: Deploy 25 | uses: peaceiris/actions-gh-pages@v3 26 | with: 27 | github_token: ${{ secrets.GITHUB_TOKEN }} 28 | publish_branch: gh-pages 29 | publish_dir: ./output 30 | keep_files: true -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tw5-github-actions-example", 3 | "version": "1.0.0", 4 | "description": "Example of using Github actions to build and publish a TiddlyWiki", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "node ./node_modules/tiddlywiki/tiddlywiki.js . --build index" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/saqimtiaz/TW5-github-actions-example.git" 12 | }, 13 | "keywords": [ 14 | "TW5", 15 | "TW5-plugins", 16 | "TiddlyWiki" 17 | ], 18 | "author": "Saq Imtiaz", 19 | "license": "BSD-3-Clause", 20 | "bugs": { 21 | "url": "https://github.com/saqimtiaz/TW5-github-actions-example/issues" 22 | }, 23 | "homepage": "https://github.com/saqimtiaz/TW5-github-actions-example#readme", 24 | "dependencies": { 25 | "tiddlywiki": "^5.1.23" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2021, Saq Imtiaz 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TW5-github-actions-example 2 | **Example of how to use Github Actions to build and publish a TiddlyWiki** 3 | 4 | Once configured, every time you push changes to your repository, an updated TiddlyWiki file will be built and published at a public URL. 5 | 6 | Starting point: a wiki folder for TiddlyWiki on node.js, being saved to a Github repository. 7 | 8 | In the root of your repository you need to: 9 | * add a `package.json` file. You can do so via `npm` using `npm init`, or by copying and modifying the `package.json` in this repo. 10 | * add TiddlyWiki as a dependency `npm install tiddlywiki` 11 | * Add a script `build` to your `package.json` file by copying from the `package.json` in 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 your `tiddlywiki.info` file is in the repository root directory, you do not need to modify this. 12 | * You can verify that everything works so far by running the command `npm run build`, the wiki HTML file should be saved in the directory `output` in the root of your repository. This directory can safely be deleted after testing. 13 | * In to the root of your repository, copy the `.github` directory from this repository. 14 | * Add these new files to Git, commit and push to Github. 15 | * The TiddlyWiki will automatically be built and pushed to your `gh-pages` branch. 16 | * 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. 17 | * Your wiki will be available at https://{username}.github.io/{reponame}, for example for this repo https://saqimtiaz.github.io/TW5-github-actions-example/ 18 | * Every time you push changes to your repository, an updated TiddlyWiki file will be built and published at this URL -------------------------------------------------------------------------------- /tiddlywiki.info: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Empty edition", 3 | "plugins": [], 4 | "themes": [ 5 | "tiddlywiki/vanilla", 6 | "tiddlywiki/snowwhite" 7 | ], 8 | "build": { 9 | "index": [ 10 | "--rendertiddler", 11 | "$:/core/save/all", 12 | "index.html", 13 | "text/plain" 14 | ], 15 | "empty": [ 16 | "--rendertiddler", 17 | "$:/core/save/all", 18 | "empty.html", 19 | "text/plain", 20 | "--rendertiddler", 21 | "$:/core/save/all", 22 | "empty.hta", 23 | "text/plain" 24 | ], 25 | "externalimages": [ 26 | "--savetiddlers", 27 | "[is[image]]", 28 | "images", 29 | "--setfield", 30 | "[is[image]]", 31 | "_canonical_uri", 32 | "$:/core/templates/canonical-uri-external-image", 33 | "text/plain", 34 | "--setfield", 35 | "[is[image]]", 36 | "text", 37 | "", 38 | "text/plain", 39 | "--rendertiddler", 40 | "$:/core/save/all", 41 | "externalimages.html", 42 | "text/plain" 43 | ], 44 | "static": [ 45 | "--rendertiddler", 46 | "$:/core/templates/static.template.html", 47 | "static.html", 48 | "text/plain", 49 | "--rendertiddler", 50 | "$:/core/templates/alltiddlers.template.html", 51 | "alltiddlers.html", 52 | "text/plain", 53 | "--rendertiddlers", 54 | "[!is[system]]", 55 | "$:/core/templates/static.tiddler.html", 56 | "static", 57 | "text/plain", 58 | "--rendertiddler", 59 | "$:/core/templates/static.template.css", 60 | "static/static.css", 61 | "text/plain" 62 | ] 63 | } 64 | } --------------------------------------------------------------------------------