-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (54 loc) · 2.2 KB
/
documentation.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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: Replace main by 2025 in canonical link
run: |
find . -type f -name "*.html" -exec sed -i 's@<link rel="canonical" href="https://zeissiqs\.github\.io/zeiss-inspect-addon-api/main/@<link rel="canonical" href="https://zeissiqs\.github\.io/zeiss-inspect-addon-api/2025/@' {} +
- 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
# NOTE:
# Targets behind login page cannot be checked!!!
# * software-store.zeiss.com/products/apps/
# * techguide.zeiss.com
# * training.gom.com
- name: Linkcheck
id: lychee
if: ${{ env.SUBDIR_NAME != 'merge' }}
uses: lycheeverse/lychee-action@v2
with:
args: --base . --verbose --no-progress '${{ env.SUBDIR_NAME }}/**/*.html'