From 7aa25d577e2df84a5156f824077bb7f6bdf28d97 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Mon, 14 Nov 2022 16:41:49 +0000 Subject: [PATCH] gh-pages action: add id-token write permission (#1265) * gh-pages action: add id-token write permission * gh-pages action: add environment --- .github/workflows/gh-pages.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index a86271a244..f751f8c5d2 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,5 +1,10 @@ name: gh-pages +permissions: + contents: read + pages: write + id-token: write + on: push: branches: @@ -9,23 +14,33 @@ jobs: deploy: name: GH-pages documentation runs-on: ubuntu-latest + environment: + name: github-pages + url: https://rust-random.github.io/rand/ + steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Install toolchain uses: dtolnay/rust-toolchain@nightly - - name: doc (rand) + + - name: Build docs env: RUSTDOCFLAGS: --cfg doc_cfg # --all builds all crates, but with default features for other crates (okay in this case) run: | cargo doc --all --features nightly,serde1,getrandom,small_rng cp utils/redirect.html target/doc/index.html + - name: Setup Pages uses: actions/configure-pages@v2 + - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: path: './target/doc' + - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v1