Skip to content

Commit b997f4c

Browse files
committed
Deploy on preview server CI changes
1 parent 2891641 commit b997f4c

File tree

3 files changed

+126
-3
lines changed

3 files changed

+126
-3
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ jobs:
7070
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
7171
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_KEY }}
7272
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
73-
# DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
74-
DOCS_DEPLOY_SERVER: "preview-docs.espressif.com"
73+
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
7574
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
76-
# DOCS_DEPLOY_URL_BASE: "https://docs.espressif.com/projects/arduino-esp32"
7775
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_USER }}
7876
run: |
7977
sudo apt update

.github/workflows/docs_deploy.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Documentation Build and Deploy CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release/*
8+
paths:
9+
- 'docs/**'
10+
- '.github/workflows/docs.yml'
11+
pull_request:
12+
paths:
13+
- 'docs/**'
14+
- '.github/workflows/docs.yml'
15+
16+
jobs:
17+
18+
build-docs:
19+
name: Build ESP-Docs
20+
runs-on: ubuntu-22.04
21+
defaults:
22+
run:
23+
shell: bash
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
submodules: true
28+
- uses: actions/setup-python@v4
29+
with:
30+
python-version: '3.10'
31+
- name: Build
32+
run: |
33+
sudo apt update
34+
sudo apt install python3-pip python3-setuptools
35+
# GitHub CI installs pip3 and setuptools outside the path.
36+
# Update the path to include them and run.
37+
cd ./docs
38+
PATH=/home/runner/.local/bin:$PATH pip3 install -r requirements.txt --prefer-binary
39+
PATH=/home/runner/.local/bin:$PATH SPHINXOPTS="-W" build-docs -l en
40+
- name: Archive Docs
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: docs
44+
path: docs
45+
46+
deploy-preview-docs:
47+
name: Deploy Documentation
48+
runs-on: ubuntu-22.04
49+
defaults:
50+
run:
51+
shell: bash
52+
steps:
53+
- uses: actions/checkout@v2
54+
with:
55+
submodules: true
56+
- uses: actions/setup-python@v2
57+
with:
58+
python-version: '3.10'
59+
- name: Deploy Preview
60+
env:
61+
# Deploy to production server
62+
# DOCS_BUILD_DIR: "./docs/_build/"
63+
# DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_DEPLOY_KEY }}
64+
# DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
65+
# DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_SERVER_USER }}
66+
# DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
67+
# DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
68+
# Deploy to preview server
69+
TYPE: "preview"
70+
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
71+
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_KEY }}
72+
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
73+
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
74+
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
75+
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_USER }}
76+
run: |
77+
sudo apt update
78+
sudo apt install python3-pip python3-setuptools
79+
source ./docs/utils.sh
80+
add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
81+
export GIT_VER=$(git describe --always)
82+
echo "PIP install requirements..."
83+
pip3 install --user -r ./docs/requirements.txt
84+
echo "Building the Docs..."
85+
cd ./docs && build-docs -l en
86+
echo "Deploy the Docs..."
87+
deploy-docs

.github/workflows/docs_legacy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build the Docs Legacy ReadTheDocs CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release/*
8+
paths:
9+
- 'docs/**'
10+
- '.github/workflows/docs_legacy.yml'
11+
pull_request:
12+
paths:
13+
- 'docs/**'
14+
- '.github/workflows/docs_legacy.yml'
15+
16+
jobs:
17+
18+
build-docs:
19+
name: Build ReadTheDocs
20+
runs-on: ubuntu-22.04
21+
defaults:
22+
run:
23+
shell: bash
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
submodules: true
28+
- uses: actions/setup-python@v4
29+
with:
30+
python-version: '3.10'
31+
- name: Build
32+
run: |
33+
sudo apt update
34+
sudo apt install python3-pip python3-setuptools
35+
# GitHub CI installs pip3 and setuptools outside the path.
36+
# Update the path to include them and run.
37+
PATH=/home/runner/.local/bin:$PATH pip3 install --user -r ./docs/requirements.txt
38+
cd ./docs && PATH=/home/runner/.local/bin:$PATH SPHINXOPTS="-W" make html

0 commit comments

Comments
 (0)