-
Notifications
You must be signed in to change notification settings - Fork 181
87 lines (81 loc) · 2.81 KB
/
docs-preview.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Publish Docs Preview
on:
push:
branches:
jobs:
publish-preview:
name: Publish docs preview
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_AWS_SECRET }}
AWS_REGION: "us-east-1"
ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }}
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-check-${{ hashFiles('**/Cargo.lock') }}
### Setup dependencies
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.7"
- name: Install Ruby + gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: "languages/ruby"
- name: Install yard
run: gem install yard
- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
### Build Rust WASM target
- name: Add WebAssembly target
run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build Rust WASM
run: make wasm-build
### Build Python package
- name: Build Python
run: make python-build
### Build docs
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.79.1"
- name: Get branch name (branch)
if: github.event_name != 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
- name: Get branch name (pull request)
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
- name: download s3-deploy package
run: |
wget https://github.com/bep/s3deploy/releases/download/v2.4.0/s3deploy_2.4.0_Linux-64bit.deb
sudo dpkg -i s3deploy_2.4.0_Linux-64bit.deb
# This step flakes sometime as in this run:
# https://github.com/osohq/oso/runs/4743006731?check_suite_focus=true
# This slows down releasing.
# Try to retry, and get some more info about why the flake is happening.
- name: Build docs for CI preview
uses: nick-invision/retry@v2
with:
max_attempts: 2
timeout_minutes: 4
command: make -C docs deploy-ci DOCS_TAG=${{ env.BRANCH_NAME }}
on_retry_command: ls docs/examples/quickstart/ruby