Skip to content

Update documentation.yaml 2023 (#208) #2284

Update documentation.yaml 2023 (#208)

Update documentation.yaml 2023 (#208) #2284

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==8.1.3 sphinx_rtd_theme==3.0.0 sphinx-favicon myst_parser==4.0.0 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: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Linkcheck
id: lychee
if: ${{ env.SUBDIR_NAME != 'merge' }}
uses: lycheeverse/lychee-action@v2
with:
args: --base . --verbose --no-progress '${{ env.SUBDIR_NAME }}/**/*.html'