chore(ci): refactor install mdbook code (#14) #6
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: Deploy book | |
on: | |
push: | |
branches: [ "master" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
name: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/install-mdbook | |
- name: Run tests | |
run: mdbook test | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/install-mdbook | |
- name: Build book | |
run: mdbook build | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: "target/book" | |
retention-days: 1 | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build] | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Permissions needed to deploy to GitHub Pages | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |