Skip to content

Commit

Permalink
Deploy on preview server CI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrominatel committed Dec 11, 2023
1 parent 2891641 commit b997f4c
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,8 @@ jobs:
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_KEY }}
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
# DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
DOCS_DEPLOY_SERVER: "preview-docs.espressif.com"
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
# DOCS_DEPLOY_URL_BASE: "https://docs.espressif.com/projects/arduino-esp32"
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_USER }}
run: |
sudo apt update
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/docs_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Documentation Build and Deploy 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 ESP-Docs
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- 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.
cd ./docs
PATH=/home/runner/.local/bin:$PATH pip3 install -r requirements.txt --prefer-binary
PATH=/home/runner/.local/bin:$PATH SPHINXOPTS="-W" build-docs -l en
- name: Archive Docs
uses: actions/upload-artifact@v2
with:
name: docs
path: docs

deploy-preview-docs:
name: Deploy Documentation
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Deploy Preview
env:
# Deploy to production server
# DOCS_BUILD_DIR: "./docs/_build/"
# DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_DEPLOY_KEY }}
# DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
# DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_SERVER_USER }}
# DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
# DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
# Deploy to preview server
TYPE: "preview"
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_KEY }}
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PATH }}
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_SERVER }}
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_URL }}
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_USER }}
run: |
sudo apt update
sudo apt install python3-pip python3-setuptools
source ./docs/utils.sh
add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
export GIT_VER=$(git describe --always)
echo "PIP install requirements..."
pip3 install --user -r ./docs/requirements.txt
echo "Building the Docs..."
cd ./docs && build-docs -l en
echo "Deploy the Docs..."
deploy-docs
38 changes: 38 additions & 0 deletions .github/workflows/docs_legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build the Docs Legacy ReadTheDocs CI

on:
push:
branches:
- master
- release/*
paths:
- 'docs/**'
- '.github/workflows/docs_legacy.yml'
pull_request:
paths:
- 'docs/**'
- '.github/workflows/docs_legacy.yml'

jobs:

build-docs:
name: Build ReadTheDocs
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- 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 SPHINXOPTS="-W" make html

0 comments on commit b997f4c

Please sign in to comment.