Update CI workflow to deploy to GitHub Pages. #68
This file contains 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: colcon.readthedocs.org | ||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update && sudo apt install -y enchant-2 graphviz | ||
python -m pip install --upgrade setuptools | ||
python -m pip install --upgrade doc8 pyenchant sphinx-rtd-theme sphinxcontrib-spelling | ||
- name: Check spelling | ||
# show list of misspelled words | ||
run: | | ||
mkdir _build | ||
make spelling | ||
if [[ -s "_build/spelling/index.spelling" ]]; then cat "_build/spelling/index.spelling"; fi | ||
- name: Build documentation | ||
run: | | ||
make html | ||
- name: Lint generated documentation | ||
run: | | ||
doc8 --max-line-length 999 index.rst developer/ migration/ user/ -v | ||
- name: Warnings and spelling errors fail the build | ||
run: | | ||
if [[ -s "_build/warnings_and_errors.log" ]]; then cat "_build/warnings_and_errors.log"; fi | ||
if [[ -s "_build/spelling/index.spelling" ]]; then cat "_build/spelling/index.spelling"; fi | ||
if [[ -s "_build/warnings_and_errors.log" ]]; then false; fi | ||
if [[ -s "_build/spelling/index.spelling" ]]; then false; fi | ||
upload: | ||
Check failure on line 43 in .github/workflows/ci.yml GitHub Actions / colcon.readthedocs.orgInvalid workflow file
|
||
if: ${{ github.event_name == "push" }} | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Upload build for GitHub Pages | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: _build/html | ||
deploy: | ||
permissions: | ||
contents: read | ||
id-token: write | ||
pages: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
if: ${{ github.event_name == "push" }} | ||
needs: upload | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |