Skip to content

Commit c9991c4

Browse files
authored
Merge pull request #343 from marcoieni/use-official-github-action
deploy book via official actions
2 parents 13b7a38 + e88e6a0 commit c9991c4

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: build and test
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
- name: Install mdbook
1616
run: |
1717
tag=$(curl -LsSf https://api.github.com/repos/rust-lang/mdBook/releases/latest | jq -r '.tag_name')
@@ -24,8 +24,25 @@ jobs:
2424
run: |
2525
git config --global http.postBuffer 50000000
2626
git config --global https.postBuffer 50000000
27-
- uses: rust-lang/simpleinfra/github-actions/static-websites@master
27+
- name: Upload book artifacts
28+
uses: actions/upload-pages-artifact@v3
2829
with:
29-
deploy_dir: book
30-
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
path: book
3131
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'rust-lang'
32+
33+
# Deploy is run as a separate job as it needs elevated permissions
34+
deploy:
35+
name: deploy
36+
runs-on: ubuntu-latest
37+
needs: test # the `test` job uploads the pages artifact
38+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'rust-lang'
39+
permissions:
40+
pages: write
41+
id-token: write
42+
environment:
43+
name: github-pages
44+
url: ${{steps.deployment.outputs.page_url}}
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
uses: actions/deploy-pages@v4
48+
id: deployment

0 commit comments

Comments
 (0)