Deploy to GitHub Pages #114
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 to GitHub Pages | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| # get_commits: | |
| # runs-on: ubuntu-latest | |
| # outputs: | |
| # commit_count: ${{ steps.commit_count.outputs.commit_count }} | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # fetch-depth: 0 | |
| # - id: commit_count | |
| # run: echo "commit_count=$(git log --oneline --since '24 hours ago' | wc -l)" >> "$GITHUB_OUTPUT" | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| # needs: get_commits | |
| # if: ${{ needs.get_commits.outputs.commit_count > 0 }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - uses: typst-community/setup-typst@v3 | |
| with: | |
| cache-dependency-path: dependencies.typ | |
| - name: Install wasm32 target | |
| run: rustup target add wasm32-unknown-unknown | |
| - name: Install just from crates.io | |
| uses: baptiste0928/cargo-install@v3 | |
| with: | |
| crate: just | |
| - name: Fetching cetz dependencies | |
| run: typst c dependencies.typ | |
| - name: Building cetz | |
| run: cd cetz && just build | |
| - name: Generate api pages | |
| run: node scripts/generate-api.js | |
| - name: Build website | |
| run: npm run build | |
| - name: Upload Build Artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: build | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| # Deploy to the github-pages environment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |