diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index 0aecf090cc..16c61686f7 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -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 \ No newline at end of file