Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Host rustdoc of master on GitHub pages #3126

Merged
merged 14 commits into from
Dec 2, 2022
48 changes: 48 additions & 0 deletions .github/workflows/docs.yml
@@ -0,0 +1,48 @@
name: Build and host documentation
on:
push:
branches:
- master

jobs:
build:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
- name: Checkout
uses: actions/checkout@v3
- name: Install nightly toolchain
run: rustup toolchain install nightly
- name: Build Documentation
run: cargo +nightly doc --no-deps --workspace -F full
env:
RUSTDOCFLAGS: "--cfg docsrs"
RUSTFLAGS: "--cfg docsrs"
umgefahren marked this conversation as resolved.
Show resolved Hide resolved
- name: Add index file
run: |
mkdir host-docs
echo "<meta http-equiv=\"refresh\" content=\"0; url=libp2p\">" > target/doc/index.html
cp -r target/doc/* ./host-docs
- name: Upload documentation
uses: actions/upload-pages-artifact@v1.0.4
with:
path: "host-docs/"

deploy:
name: Deploy documentation
needs: build
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1