-
Notifications
You must be signed in to change notification settings - Fork 75
68 lines (55 loc) · 2.05 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Documentation
on:
push:
branches:
- master
paths:
# For the current generated documentation, these trigger paths are sufficient.
# Long-term, job-level triggers are more appropriate.
# https://how.wtf/run-workflow-step-or-job-based-on-file-changes-github-actions.html
- src/fundus/publishers/**
- scripts/generate_tables.py
# https://github.com/stefanzweifel/git-auto-commit-action/issues/211#issuecomment-1100105924
pull_request_target:
paths:
- src/fundus/publishers/**
- scripts/generate_tables.py
workflow_dispatch:
env:
PYTHONPATH: .
CI_COMMIT_MESSAGE: >-
${{
github.event_name == 'pull_request'
&& format('Update documentation from @ {0} (#{1})', github.event.pull_request.head.sha, github.event.number)
|| format('Update documentation from @ {0}', github.sha)
}}
jobs:
supported_publishers:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set up Git repository
uses: actions/checkout@v4
# https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#use-in-forks-from-public-repositories
with:
# Checkout the fork/head-repository and push changes to the fork.
# If you skip this, the base repository will be checked out and changes
# will be committed to the base repository!
repository: ${{ github.event.pull_request.head.repo.full_name }}
# Checkout the branch made in the fork. Will automatically push changes
# back to this branch.
ref: ${{ github.head_ref }}
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install Fundus
run: pip install -e .[dev]
- name: Generate 'supported_publishers.md'
run: python scripts/generate_tables.py
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ env.CI_COMMIT_MESSAGE }}
file_pattern: docs