Skip to content

Commit 07f2a9a

Browse files
committed
ci: Use GitHub Pages with Actions
Use GitHub Pages with Actions and split jobs with fine-grained permissions. Remove dependency on peaceiris/actions-gh-pages See https://github.blog/news-insights/product-news/github-pages-now-uses-actions-by-default/ Add workflow_dispatch to be able to manually run this action. Update Ubuntu to 24.04. Signed-off-by: Mickaël Salaün <mic@digikod.net>
1 parent 11d4ef1 commit 07f2a9a

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

.github/workflows/pages.yml

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
name: GitHub Pages
22

3-
permissions:
4-
contents: write
5-
63
on:
74
push:
85
branches: [ main ]
96

10-
env:
11-
CARGO_TERM_COLOR: always
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: "pages"
11+
cancel-in-progress: false
1212

1313
jobs:
14-
rustdoc:
14+
build:
1515
if: github.repository == 'landlock-lsm/rust-landlock'
16-
runs-on: ubuntu-22.04
17-
concurrency:
18-
group: ${{ github.workflow }}-${{ github.ref }}
19-
cancel-in-progress: true
16+
runs-on: ubuntu-24.04
17+
18+
env:
19+
CARGO_TERM_COLOR: always
20+
21+
permissions:
22+
contents: read
23+
id-token: write
24+
2025
steps:
2126
- uses: actions/checkout@v3
2227

@@ -33,11 +38,22 @@ jobs:
3338
run: |
3439
echo '<meta http-equiv="refresh" content="0; url=landlock">' > target/doc/index.html
3540
36-
- name: Push documentation
37-
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # v3.8.0
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
3843
with:
39-
github_token: ${{ secrets.GITHUB_TOKEN }}
40-
publish_dir: target/doc
41-
force_orphan: true
42-
user_name: 'github-actions[bot]'
43-
user_email: 'github-actions[bot]@users.noreply.github.com'
44+
path: target/doc
45+
46+
deploy:
47+
needs: build
48+
runs-on: ubuntu-24.04
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
53+
permissions:
54+
pages: write
55+
id-token: write
56+
57+
steps:
58+
- name: Deploy to GitHub Pages
59+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)