Skip to content

Updated

Updated #2155

Workflow file for this run

name: Docs
on: [push, pull_request, workflow_dispatch]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install sphinx==7.4.7 sphinx_rtd_theme sphinx-favicon myst_parser sphinx_sitemap sphinxcontrib.newsfeed
- name: Sphinx build
run: |
sphinx-build -W --keep-going doc _build
if [ $? -ne 0 ]; then
echo -e "\033[1;31mSphinx build FAILED\033[0m\n"
exit 1
else
echo -e "\033[1;32mSphinx build PASSED\033[0m\n"
fi
- name: Insert RSS link into news page HTML header
run: |
sed -i 's|</head>| <link rel="alternate" type="application/rss+xml" title="ZEISS INSPECT Add-on Python API News Feed" href="../index.rss" />\n</head>|' _build/news/news.html
- name: Set branch name
id: branch
run: echo "SUBDIR_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Deploy
if: ${{ github.event_name != 'pull_request' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
destination_dir: ${{ env.SUBDIR_NAME }}
full_commit_message: Deploy documentation of '${{ env.SUBDIR_NAME }}' to GitHub Pages
- name: Delay
run: |
echo "Allowing 'pages build and deployment' to finish"
# This usually takes less than a minute...
sleep 90s
- name: Linkcheck
if: ${{ env.SUBDIR_NAME != 'merge' }}
uses: filiph/linkcheck@3.0.0
with:
arguments: https://zeissiqs.github.io/zeiss-inspect-addon-api/${{ env.SUBDIR_NAME }}/ -e --skip-file .github/workflows/skip_links.txt