forked from espressif/arduino-esp32
-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (91 loc) · 3.17 KB
/
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
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
88
89
90
91
92
93
94
95
96
name: Docs CI
on:
push:
branches:
- master
- release/*
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
pull_request:
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
jobs:
build-docs:
name: Build Docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Build
run: |
sudo apt update
sudo apt install python3-pip python3-setuptools
# GitHub CI installs pip3 and setuptools outside the path.
# Update the path to include them and run.
PATH=/home/runner/.local/bin:$PATH pip3 install --user -r ./docs/requirements.txt
cd ./docs && PATH=/home/runner/.local/bin:$PATH build-docs -l en
deploy-docs:
name: Deploy Docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Deploy Production
env:
DOCS_BUILD_DIR: "./docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_DEPLOY_KEY }}
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_PROD_SERVER }}
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_PROD_SERVER_USER }}
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
run: |
PATH=/home/runner/.local/bin:$PATH pip install -r ./docs/requirements.txt --prefer-binary
PATH=/home/runner/.local/bin:$PATH source ./docs/utils.sh
PATH=/home/runner/.local/bin:$PATH add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
PATH=/home/runner/.local/bin:$PATH export GIT_VER=$(git describe --always)
cd ./docs && PATH=/home/runner/.local/bin:$PATH build-docs -l en
PATH=/home/runner/.local/bin:$PATH deploy-docs
deploy-preview-docs:
name: Deploy Preview Docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Deploy Preview
env:
DOCS_BUILD_DIR: "./docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_DEPLOY_KEY }}
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_PREV_SERVER }}
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_PREV_SERVER_USER }}
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PREV_PATH }}
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_PREV_URL }}
run: |
PATH=/home/runner/.local/bin:$PATH pip install -r ./docs/requirements.txt --prefer-binary
PATH=/home/runner/.local/bin:$PATH source ./docs/utils.sh
PATH=/home/runner/.local/bin:$PATH add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
PATH=/home/runner/.local/bin:$PATH export GIT_VER=$(git describe --always)
cd ./docs && PATH=/home/runner/.local/bin:$PATH build-docs -l en
PATH=/home/runner/.local/bin:$PATH deploy-docs