This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Tiddlywiki To Github Pages | |
on: | |
push: | |
branches: | |
- main | |
- master | |
# paths: | |
# - "plugins/**" | |
# - "tiddlers/**" | |
# - "package.json" | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3.6.0 | |
with: | |
node-version: '18' | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
**/node_modules | |
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }} | |
- name: Install Dependency | |
run: npm install | |
# - name: 运行zx构建 | |
# run: npm run zx-build | |
- name: Building online versions of web pages | |
run: npm run buildonline | |
- name: Building downloadable offline versions of web pages | |
run: npm run buildoffline | |
- name: Workbox offline cache | |
run: npx workbox injectManifest workbox-config.js | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1.0.8 | |
with: | |
# Upload entire repository | |
path: ./public-dist | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2.0.2 |