Skip to content

Commit a88a9c9

Browse files
committed
Added back the deploy on PR - Clean CI 6
1 parent 22029af commit a88a9c9

File tree

2 files changed

+122
-0
lines changed

2 files changed

+122
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Documentation Build and Deploy CI
2+
3+
on:
4+
push:
5+
branches:
6+
- release/*
7+
paths:
8+
- 'docs/**'
9+
- '.github/workflows/docs.yml'
10+
pull_request:
11+
paths:
12+
- 'docs/**'
13+
- '.github/workflows/docs.yml'
14+
15+
jobs:
16+
17+
deploy-preview-docs:
18+
name: Deploy Documentation
19+
runs-on: ubuntu-22.04
20+
defaults:
21+
run:
22+
shell: bash
23+
steps:
24+
- uses: actions/checkout@v2
25+
with:
26+
submodules: true
27+
- uses: actions/setup-python@v2
28+
with:
29+
python-version: '3.10'
30+
- name: Deploy Preview
31+
env:
32+
# Deploy to production server
33+
# DOCS_BUILD_DIR: "./docs/_build/"
34+
# DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_DEPLOY_KEY }}
35+
# DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
36+
# DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_SERVER_USER }}
37+
# DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
38+
# DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
39+
# Deploy to preview server
40+
TYPE: "preview"
41+
# DOCS_BUILD_DIR: "./docs/_build"
42+
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_KEY }}
43+
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
44+
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
45+
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
46+
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_USER }}
47+
run: |
48+
sudo apt update
49+
sudo apt install python3-pip python3-setuptools
50+
source ./docs/utils.sh
51+
add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
52+
export GIT_VER=$(git describe --always)
53+
echo "PIP install requirements..."
54+
pip3 install --user -r ./docs/requirements.txt
55+
echo "Building the Docs..."
56+
cd ./docs && build-docs -l en
57+
echo "Deploy the Docs..."
58+
export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs/
59+
cd $GITHUB_WORKSPACE/docs
60+
deploy-docs
61+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Documentation Build and Deploy CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'docs/**'
9+
- '.github/workflows/docs.yml'
10+
pull_request:
11+
paths:
12+
- 'docs/**'
13+
- '.github/workflows/docs.yml'
14+
15+
jobs:
16+
17+
deploy-preview-docs:
18+
name: Deploy Documentation
19+
runs-on: ubuntu-22.04
20+
defaults:
21+
run:
22+
shell: bash
23+
steps:
24+
- uses: actions/checkout@v2
25+
with:
26+
submodules: true
27+
- uses: actions/setup-python@v2
28+
with:
29+
python-version: '3.10'
30+
- name: Deploy Preview
31+
env:
32+
# Deploy to production server
33+
# DOCS_BUILD_DIR: "./docs/_build/"
34+
# DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_DEPLOY_KEY }}
35+
# DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
36+
# DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_SERVER_USER }}
37+
# DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
38+
# DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
39+
# Deploy to preview server
40+
TYPE: "preview"
41+
# DOCS_BUILD_DIR: "./docs/_build"
42+
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_KEY }}
43+
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
44+
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
45+
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
46+
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_USER }}
47+
run: |
48+
sudo apt update
49+
sudo apt install python3-pip python3-setuptools
50+
source ./docs/utils.sh
51+
add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
52+
export GIT_VER=$(git describe --always)
53+
echo "PIP install requirements..."
54+
pip3 install --user -r ./docs/requirements.txt
55+
echo "Building the Docs..."
56+
cd ./docs && build-docs -l en
57+
echo "Deploy the Docs..."
58+
export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs/
59+
cd $GITHUB_WORKSPACE/docs
60+
deploy-docs
61+

0 commit comments

Comments
 (0)