Deploy jaq playground #28
This file contains hidden or 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 jaq playground | |
| on: | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # 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: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install wasm-pack | |
| shell: bash | |
| run: | | |
| VERSION="0.12.1" | |
| DIR=wasm-pack-v${VERSION}-x86_64-unknown-linux-musl | |
| wget https://github.com/rustwasm/wasm-pack/releases/download/v${VERSION}/${DIR}.tar.gz | |
| tar xzf ${DIR}.tar.gz | |
| mv ${DIR}/wasm-pack ~/.cargo/bin | |
| - name: Compile | |
| run: wasm-pack build --target web --no-typescript --no-pack --release | |
| working-directory: jaq-play | |
| - name: Install jotdown | |
| run: cargo install jotdown@0.8.1 --locked | |
| - name: Generate documentation | |
| working-directory: docs | |
| run: make JAQ="cargo run --" MANUAL.xhtml | |
| - name: Move documentation | |
| run: | | |
| mkdir jaq-play/manual | |
| mv docs/MANUAL.xhtml jaq-play/manual/index.html | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'jaq-play' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |