From 335878349ca28ed0a4aed7b2a9f90f1b6b64ed0c Mon Sep 17 00:00:00 2001 From: Ruud van Asseldonk Date: Wed, 22 May 2024 11:18:10 +0200 Subject: [PATCH] Add a deployment workflow --- .github/workflows/deploy.yml | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f5fbedc --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,40 @@ +name: Deploy + +"on": + workflow_dispatch: {} + push: + branches: ["master"] + +jobs: + Build: + runs-on: ubuntu-latest + + # Ask for a token with the right permissions to publish. It would be slightly + # safer to split into two jobs, so the untrusted mdBook binary does not have + # access to the token, but the worst you can do is deface the webpage which + # a malicious mdBook could do anyway, so we keep the workflow simple. + permissions: + contents: read + pages: write + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Install mdBook + run: | + curl -sSL "https://github.com/rust-lang/mdBook/releases/download/$(cat mdbook-version)/mdbook-$(cat mdbook-version)-x86_64-unknown-linux-gnu.tar.gz" | tar -xz + + - name: Build and test the book + run: | + ./mdbook build + ./mdbook test + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3.0.1 + with: + path: "book" + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4.0.5