Skip to content

Commit 97ffb24

Browse files
authored
Merge pull request #231 from miikka/simplify-pages-upload
Migrate GitHub Pages deployment away from the static-websites action
2 parents 1040082 + a0d4f1f commit 97ffb24

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,24 @@ jobs:
2020
uses: taiki-e/install-action@mdbook-linkcheck
2121
- run: mdbook build
2222
- run: cargo test --all --manifest-path=./examples/Cargo.toml --target-dir ./target
23-
- uses: rust-lang/simpleinfra/github-actions/static-websites@master
23+
- uses: actions/upload-pages-artifact@v3
2424
with:
25-
deploy_dir: book/html
26-
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
path: book/html
2726
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'rust-lang'
27+
28+
# Deploy is run as a separate job as it needs elevated permissions
29+
deploy:
30+
name: deploy
31+
needs: test # the `test` job uploads the pages artifact
32+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'rust-lang'
33+
permissions:
34+
pages: write
35+
id-token: write
36+
environment:
37+
name: github-pages
38+
url: ${{steps.deployment.outputs.page_url}}
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Deploy to GitHub Pages
42+
uses: actions/deploy-pages@v4
43+
id: deployment

0 commit comments

Comments
 (0)