docs: update example for load data from remote #386
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: typst_ts::release::gh_pages | |
env: | |
SCCACHE_GHA_ENABLED: 'true' | |
RUSTC_WRAPPER: 'sccache' | |
CARGO_INCREMENTAL: '0' | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ['main'] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
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: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Mold | |
uses: rui314/setup-mold@v1 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install Rust for Wasm targets | |
run: rustup target add wasm32-unknown-unknown | |
- name: Set Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install wasm-pack | |
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | bash | |
- name: Download & install typst-book | |
run: | | |
curl -L https://github.com/Myriad-Dreamin/typst-book/releases/download/v0.1.2-nightly2/typst-book-x86_64-unknown-linux-gnu.tar.gz | tar -xvz | |
chmod +x typst-book-x86_64-unknown-linux-gnu/bin/typst-book | |
sudo cp typst-book-x86_64-unknown-linux-gnu/bin/typst-book /usr/bin/typst-book | |
- name: Run sccache-cache | |
uses: mozilla-actions/sccache-action@v0.0.3 | |
- name: Prepare fonts | |
run: cargo run --profile release-ci --bin typst-ts-fontctl | |
- name: Download font assets | |
run: | | |
curl -L https://github.com/Myriad-Dreamin/typst-book/releases/download/v0.1.0/charter-font-assets.tar.gz | tar -xvz -C assets/fonts | |
- name: Build | |
run: | | |
cargo build --profile release-ci --bin typst-ts-cli | |
- name: Install packages | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: install | |
- name: Build Typescript packages | |
run: | | |
npx turbo run build | |
- name: Prepare artifacts | |
run: | | |
typst-book build --font-path assets/fonts --path-to-root /typst.ts/cookery/ -w . -d ../../github-pages/cookery/ docs/cookery | |
cargo run --profile release-ci --bin typst-ts-cli -- compile --workspace ./github-pages/docs/ --entry ./github-pages/docs/readme.typ --format=pdf --format=vector | |
- name: Copy assets | |
run: | | |
mkdir -p github-pages/compiler/ | |
mkdir -p github-pages/renderer/ | |
cp packages/compiler/pkg/* github-pages/compiler/ | |
cp packages/renderer/pkg/* github-pages/renderer/ | |
cp packages/typst.ts/dist/esm/main.bundle.js github-pages/typst-main.js | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload `/github-pages` sub directory | |
path: './github-pages' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |