summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-29 23:04:21 +0000
committerbors <bors@rust-lang.org>2022-09-29 23:04:21 +0000
commita15719442d7231dc01baaf71c26d5228e02f60f2 (patch)
tree36ae11efce3d08dadb681d108002de09fe12f55c
parenta2281d3d4def7d583e42a8204b3df7c3576d3512 (diff)
parent9dc36bdcb0fe28da0aaf9ca17f70020a685ba4e6 (diff)
downloadrust-libc-a15719442d7231dc01baaf71c26d5228e02f60f2.tar.gz
Auto merge of #2933 - JohnTitor:ghpages-from-gha, r=JohnTitor
Deploy GitHub Pages via GitHub Actions This simplifies the deployment workflow. Tested it works fine on https://github.com/JohnTitor/libc/actions/runs/3151392197, you can also see https://johntitor.github.io/libc/. r? `@ghost` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
-rw-r--r--.github/workflows/docs.yml43
1 files changed, 22 insertions, 21 deletions
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 11eac70fca..50102b83ec 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -1,34 +1,35 @@
-name: Upload documentation
+name: Upload documentation to GitHub Pages
on:
push:
branches:
- master
+# Sets permissions of `GITHUB_TOKEN` to allow deployment to GitHub Pages
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
jobs:
- upload_docs:
- name: Upload documentation
+ deploy:
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
- if: github.repository == 'rust-lang/libc'
-
steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
+ - name: Checkout
+ uses: actions/checkout@v3
- name: Setup Rust toolchain
run: TARGET=x86_64-unknown-linux-gnu sh ./ci/install-rust.sh
- name: Generate documentation
run: LIBC_CI=1 sh ci/dox.sh
- - name: Deploy GitHub Pages
- run: |
- git worktree add gh-pages gh-pages
- git config user.name "Deploy from CI"
- git config user.email ""
- cd gh-pages
- # Delete the ref to avoid keeping history.
- git update-ref -d refs/heads/gh-pages
- rm -rf *
- mv ../target/doc/* .
- git add .
- git commit -m "Deploy $GITHUB_SHA to gh-pages"
- git push --force
+ - 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