-
Notifications
You must be signed in to change notification settings - Fork 15
40 lines (34 loc) · 1.15 KB
/
publish-rust-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: publish
on:
push:
branches:
- master
pull_request:
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git
jobs:
docs:
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
name: docs
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install apt dependencies
run: |
sudo apt-get update && \
sudo apt-get install -y clang libssl-dev llvm libudev-dev libgmp3-dev protobuf-compiler && \
sudo rm -rf /var/lib/apt/lists/*
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
- name: Build documentation
run: cargo doc --no-deps
- name: Publish documentation
run: |
cd target/doc
git init
echo '<meta http-equiv="refresh" content="0; url=https://webb-tools.github.io/dkg-substrate/dkg_gadget/index.html">' > index.html
git add .
git -c user.name='ci' -c user.email='ci' commit -m 'Deploy documentation'
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages