feat(docs): Add LiquidCrystal_I2C example and CI configuration for I2… #65
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Documentation Build and Deploy CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - release/v2.x | |
| - docs-embed | |
| paths: | |
| - "docs/**" | |
| - ".github/workflows/docs_build.yml" | |
| pull_request: | |
| paths: | |
| - "docs/**" | |
| - ".github/workflows/docs_build.yml" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-docs: | |
| name: Build ESP-Docs | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.0.4 | |
| with: | |
| cache-dependency-path: docs/requirements.txt | |
| cache: "pip" | |
| python-version: "3.10" | |
| # Install Arduino CLI and set environment variables | |
| - name: Install Arduino CLI | |
| run: | | |
| source .github/scripts/install-arduino-cli.sh | |
| echo "ARDUINO_IDE_PATH=$ARDUINO_IDE_PATH" >> $GITHUB_ENV | |
| echo "ARDUINO_USR_PATH=$ARDUINO_USR_PATH" >> $GITHUB_ENV | |
| # Install ESP32 Arduino Core | |
| - name: Install ESP32 Arduino Core | |
| run: | | |
| source .github/scripts/install-arduino-core-esp32.sh | |
| # Install Python dependencies needed for docs_build_examples.py | |
| - name: Install Python Dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install python3-pip python3-setuptools | |
| cd ./docs | |
| PATH=/home/runner/.local/bin:$PATH pip3 install -r requirements.txt --prefer-binary | |
| # Set documentation embedding environment variables | |
| - name: Set Documentation Environment Variables | |
| run: | | |
| # configure env vars for docs_build_examples.py and docs build | |
| echo "DOCS_EMBED_GITHUB_BASE_URL=https://github.com/${{ github.repository }}" >> $GITHUB_ENV | |
| echo "DOCS_EMBED_GITHUB_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV | |
| echo "DOCS_EMBED_PUBLIC_ROOT=https://${{ secrets.DOCS_SERVER }}/${{ secrets.DOCS_PATH }}/en/${{ github.ref_name == 'master' && 'latest' || github.ref_name }}/" >> $GITHUB_ENV | |
| echo "DOCS_EMBED_BINARIES_DIR=${{ vars.DOCS_EMBED_BINARIES_DIR }}" >> $GITHUB_ENV | |
| echo "DOCS_EMBED_LAUNCHPAD_URL=${{ vars.DOCS_EMBED_LAUNCHPAD_URL }}" >> $GITHUB_ENV | |
| echo "DOCS_EMBED_WOKWI_VIEWER_URL=${{ vars.DOCS_EMBED_WOKWI_VIEWER_URL }}" >> $GITHUB_ENV | |
| echo "DOCS_EMBED_ABOUT_WOKWI_URL=${{ vars.DOCS_EMBED_ABOUT_WOKWI_URL }}" >> $GITHUB_ENV | |
| # Build examples using environment variables from install script | |
| - name: Build Examples | |
| run: | | |
| PATH=/home/runner/.local/bin:$PATH python3 .github/scripts/docs_build_examples.py --build --diagram --launchpad | |
| - name: Cleanup Binaries | |
| run: | | |
| PATH=/home/runner/.local/bin:$PATH python3 .github/scripts/docs_build_examples.py -c | |
| - name: Build | |
| run: | | |
| cd ./docs | |
| PATH=/home/runner/.local/bin:$PATH SPHINXOPTS="-W" build-docs -l en | |
| - name: Archive Docs | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: docs | |
| path: docs |