revision on office hour #18
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: Build and deploy mdBook site | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build with mdBook | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- uses: cargo-bins/cargo-binstall@main | |
- name: Install mdBook, mdBook-KaTeX, and mdBook-ToC | |
run: cargo binstall -y mdbook mdbook-katex mdbook-toc | |
- name: Build | |
run: mdbook build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
deploy: | |
name: Deploy the site to GitHub Pages | |
needs: build | |
if: github.event_name == 'push' | |
permissions: | |
pages: write | |
id-token: write | |
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 |