-
Notifications
You must be signed in to change notification settings - Fork 621
51 lines (49 loc) · 1.72 KB
/
protocol-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
41
42
43
44
45
46
47
48
49
50
51
name: Render and Deploy Docs
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
name: Render and deploy protocol and API docs
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v4
with:
lfs: true
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Load Rust caching
uses: astriaorg/[email protected]
- name: Load get-version action to grab version component of deployment path
uses: battila7/get-version-action@v2
id: get_version
- name: Print version component of deployment path
run: echo ${{ steps.get_version.outputs.version }}
- name: Install mdbook
run: cargo install mdbook mdbook-katex mdbook-mermaid
- name: Build protocol spec
run: cd docs/protocol && mdbook build
- name: Move protocol spec to subdirectory & Deploy
env:
DO_DOCS_PK: ${{ secrets.DO_DOCS_PK }}
DO_DOCS_IP: ${{ secrets.DO_DOCS_IP }}
run: |
cd docs/protocol
if [ -d "do-tmp" ]; then rm -rf do-tmp; fi
mkdir do-tmp
mv book do-tmp/${{ steps.get_version.outputs.version }}
tree do-tmp
which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
which rsync || ( apt-get update -y && apt-get install rsync -y )
eval $(ssh-agent -s)
ssh-add <(echo "$DO_DOCS_PK" )
mkdir -p ~/.ssh
chmod 700 ~/.ssh
ssh-keyscan $DO_DOCS_IP >> ~/.ssh/known_hosts
chmod 644 ~/.ssh/known_hosts
cd do-tmp/main
scp -r * root@$DO_DOCS_IP:/var/www/html