ci: book deployment workflow (#242)

* ci: book deployment workflow

* ci: modernize book publish workflow
This commit is contained in:
Bjerg
2022-11-24 12:40:31 +01:00
committed by GitHub
parent f4dbeddc97
commit 78e7fbaee6

View File

@@ -27,3 +27,42 @@ jobs:
- name: Run tests
run: mdbook test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install mdbook
run: |
mkdir mdbook
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build
run: mdbook build
- name: Save pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: target/book
deploy:
runs-on: ubuntu-latest
needs: [test, build]
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1