mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-16 04:41:20 +00:00
51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
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@64c0c85d18e984422218383b81c52f8b077404d3 # v1.1.2
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- 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"
|
|
- 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.7
|
|
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
|
|
|