Skip to content

Commit 82a9e2c

Browse files
authored
feat: Host rustdoc of master on GitHub pages (#3126)
This PR hosts the documentation of the current master branch on GitHub Pages. The URL should be: https://libp2p.github.io/rust-libp2p
1 parent be0b62a commit 82a9e2c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/docs.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build and host documentation
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
build:
9+
name: Build documentation
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Install Protoc
13+
uses: arduino/setup-protoc@v1
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
- name: Install nightly toolchain
17+
run: rustup toolchain install nightly
18+
- name: Build Documentation
19+
run: cargo +nightly doc --no-deps --workspace -F full
20+
env:
21+
RUSTDOCFLAGS: "--cfg docsrs"
22+
RUSTFLAGS: "--cfg docsrs"
23+
- name: Add index file
24+
run: |
25+
mkdir host-docs
26+
echo "<meta http-equiv=\"refresh\" content=\"0; url=libp2p\">" > target/doc/index.html
27+
cp -r target/doc/* ./host-docs
28+
- name: Upload documentation
29+
uses: actions/upload-pages-artifact@v1.0.4
30+
with:
31+
path: "host-docs/"
32+
33+
deploy:
34+
name: Deploy documentation
35+
needs: build
36+
permissions:
37+
pages: write
38+
id-token: write
39+
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Deploy to GitHub Pages
46+
id: deployment
47+
uses: actions/deploy-pages@v1
48+

0 commit comments

Comments
 (0)