File tree 1 file changed +22
-21
lines changed
1 file changed +22
-21
lines changed Original file line number Diff line number Diff line change 1
- name : Upload documentation
1
+ name : Upload documentation to GitHub Pages
2
2
3
3
on :
4
4
push :
5
5
branches :
6
6
- master
7
7
8
+ # Sets permissions of `GITHUB_TOKEN` to allow deployment to GitHub Pages
9
+ permissions :
10
+ contents : read
11
+ pages : write
12
+ id-token : write
13
+
8
14
jobs :
9
- upload_docs :
10
- name : Upload documentation
15
+ deploy :
16
+ environment :
17
+ name : github-pages
18
+ url : ${{ steps.deployment.outputs.page_url }}
11
19
runs-on : ubuntu-22.04
12
- if : github.repository == 'rust-lang/libc'
13
-
14
20
steps :
15
- - uses : actions/checkout@v3
16
- with :
17
- fetch-depth : 0
21
+ - name : Checkout
22
+ uses : actions/checkout@v3
18
23
- name : Setup Rust toolchain
19
24
run : TARGET=x86_64-unknown-linux-gnu sh ./ci/install-rust.sh
20
25
- name : Generate documentation
21
26
run : LIBC_CI=1 sh ci/dox.sh
22
- - name : Deploy GitHub Pages
23
- run : |
24
- git worktree add gh-pages gh-pages
25
- git config user.name "Deploy from CI"
26
- git config user.email ""
27
- cd gh-pages
28
- # Delete the ref to avoid keeping history.
29
- git update-ref -d refs/heads/gh-pages
30
- rm -rf *
31
- mv ../target/doc/* .
32
- git add .
33
- git commit -m "Deploy $GITHUB_SHA to gh-pages"
34
- git push --force
27
+ - name : Setup Pages
28
+ uses : actions/configure-pages@v2
29
+ - name : Upload artifact
30
+ uses : actions/upload-pages-artifact@v1
31
+ with :
32
+ path : ' target/doc'
33
+ - name : Deploy to GitHub Pages
34
+ id : deployment
35
+ uses : actions/deploy-pages@v1
You can’t perform that action at this time.
0 commit comments