test: add touying test assets #214
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: GitHub Pages | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "*" | |
workflow_dispatch: | |
permissions: | |
pages: write | |
id-token: write | |
contents: read | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build-gh-pages: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: { submodules: recursive } | |
- uses: rui314/setup-mold@v1 | |
- uses: dtolnay/rust-toolchain@stable | |
with: { targets: wasm32-unknown-unknown } | |
- uses: jetli/wasm-pack-action@v0.4.0 | |
with: | |
version: "v0.12.1" | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install the latest version of rye | |
uses: eifinger/setup-rye@v3 | |
with: | |
enable-cache: true | |
cache-prefix: 'typstyle-rye' | |
- run: | | |
wasm-pack build | |
- name: Publish to npm | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
cd pkg | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Build demo | |
run: | | |
cd web | |
yarn | |
yarn build --outDir ../docs/demo | |
- name: Build docs site | |
run: | | |
rye sync | |
rye run docs-build | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload `/github-pages` sub directory | |
path: "site" | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |