Improve and simplify reading and writing of tools on the example of print_array_elements #1380
Workflow file for this run
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: CI-docs | |
# Build and deploy docs to gh-pages | |
on: | |
pull_request: | |
branches: [main] | |
types: [opened, closed, synchronize] | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.10.4 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.10.4 | |
- name: Python dependencies | |
run: | | |
python --version | |
pip install '.[doc]' | |
- name: Check for non-ASCII characters | |
run: | | |
output=$(perl -ne 'print if /[^[:ascii:]]/' docs/source/*) | |
if [ -n "$output" ]; then | |
echo "Non-ASCII characters found in documentation." | |
exit 1 | |
fi | |
- name: Build docs | |
shell: bash -l {0} | |
run: | | |
make -C docs/ html | |
exit_code=$? | |
if [ $exit_code -ne 0 ]; then | |
echo "Make command failed with exit code $exit_code" | |
exit $exit_code | |
fi | |
touch docs/build/html/.nojekyll | |
- name: Deploy to github pages | |
# only run when PR is merged | |
if: github.event.pull_request.merged | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: docs/build/html | |
CLEAN: true |