-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (149 loc) · 6.9 KB
/
Copy pathgenerate-reference.yml
File metadata and controls
160 lines (149 loc) · 6.9 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Generate reference
# Auto-generates the reference documentation for the whole OpenPipeline
# ecosystem from source. This repo pulls each package, runs the Viash
# documentation generator over its configs, and opens a PR with the result —
# so the reference can never drift from the code, and no package repo needs a
# workflow of its own.
#
# Requires repo secret GTHB_PAT: a GitHub PAT with viash-hub pro access (and
# read access to any private package repo).
on:
workflow_dispatch:
inputs:
ref:
description: "Branch or tag to generate from for every package (default: main)."
type: string
default: main
schedule:
- cron: "0 6 * * 1" # Mondays 06:00 UTC
permissions:
contents: write
pull-requests: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Checkout docs
uses: actions/checkout@v4
with:
path: openpipeline_docs
token: ${{ secrets.GTHB_PAT }}
# Package checkouts pass the PAT so private repos resolve and so the same
# token is available for a re-added private package later.
- name: Checkout openpipeline
uses: actions/checkout@v4
with: { repository: openpipelines-bio/openpipeline, ref: "${{ inputs.ref || 'main' }}", path: openpipeline, token: "${{ secrets.GTHB_PAT }}" }
- name: Checkout openpipeline_spatial
uses: actions/checkout@v4
with: { repository: openpipelines-bio/openpipeline_spatial, ref: "${{ inputs.ref || 'main' }}", path: openpipeline_spatial, token: "${{ secrets.GTHB_PAT }}" }
- name: Checkout openpipeline_qc
uses: actions/checkout@v4
with: { repository: openpipelines-bio/openpipeline_qc, ref: "${{ inputs.ref || 'main' }}", path: openpipeline_qc, token: "${{ secrets.GTHB_PAT }}" }
- name: Checkout openpipeline_composed
uses: actions/checkout@v4
with: { repository: openpipelines-bio/openpipeline_composed, ref: "${{ inputs.ref || 'main' }}", path: openpipeline_composed, token: "${{ secrets.GTHB_PAT }}" }
- uses: viash-io/viash-actions/setup@v6
# Two passes per package (the proven openpipeline→website recipe): modules
# first (clean:true wipes stale pages), then workflows (clean:false appends).
# Both land under reference/<package>/<namespace>/<name>.qmd. A single
# combined query returned zero components, so mirror the working split.
- name: Generate — openpipeline (modules)
uses: viash-io/viash-actions/pro/generate-documentation-qmd@v6
with:
project_directory: openpipeline
query: '^(?!workflows|test_workflows)'
output_dir: ../openpipeline_docs/reference/openpipeline/
dest_path: "{namespace}/{name}.qmd"
viash_pro_token: ${{ secrets.GTHB_PAT }}
tools_version: main_build
clean: true
- name: Generate — openpipeline (workflows)
uses: viash-io/viash-actions/pro/generate-documentation-qmd@v6
with:
project_directory: openpipeline
query: '^workflows'
output_dir: ../openpipeline_docs/reference/openpipeline/
dest_path: "{namespace}/{name}.qmd"
viash_pro_token: ${{ secrets.GTHB_PAT }}
tools_version: main_build
clean: false
- name: Generate — openpipeline_spatial (modules)
uses: viash-io/viash-actions/pro/generate-documentation-qmd@v6
with:
project_directory: openpipeline_spatial
query: '^(?!workflows|test_workflows)'
output_dir: ../openpipeline_docs/reference/openpipeline_spatial/
dest_path: "{namespace}/{name}.qmd"
viash_pro_token: ${{ secrets.GTHB_PAT }}
tools_version: main_build
clean: true
- name: Generate — openpipeline_spatial (workflows)
uses: viash-io/viash-actions/pro/generate-documentation-qmd@v6
with:
project_directory: openpipeline_spatial
query: '^workflows'
output_dir: ../openpipeline_docs/reference/openpipeline_spatial/
dest_path: "{namespace}/{name}.qmd"
viash_pro_token: ${{ secrets.GTHB_PAT }}
tools_version: main_build
clean: false
- name: Generate — openpipeline_qc (modules)
uses: viash-io/viash-actions/pro/generate-documentation-qmd@v6
with:
project_directory: openpipeline_qc
query: '^(?!workflows|test_workflows)'
output_dir: ../openpipeline_docs/reference/openpipeline_qc/
dest_path: "{namespace}/{name}.qmd"
viash_pro_token: ${{ secrets.GTHB_PAT }}
tools_version: main_build
clean: true
- name: Generate — openpipeline_qc (workflows)
uses: viash-io/viash-actions/pro/generate-documentation-qmd@v6
with:
project_directory: openpipeline_qc
query: '^workflows'
output_dir: ../openpipeline_docs/reference/openpipeline_qc/
dest_path: "{namespace}/{name}.qmd"
viash_pro_token: ${{ secrets.GTHB_PAT }}
tools_version: main_build
clean: false
- name: Generate — openpipeline_composed (modules)
uses: viash-io/viash-actions/pro/generate-documentation-qmd@v6
with:
project_directory: openpipeline_composed
query: '^(?!workflows|test_workflows)'
output_dir: ../openpipeline_docs/reference/openpipeline_composed/
dest_path: "{namespace}/{name}.qmd"
viash_pro_token: ${{ secrets.GTHB_PAT }}
tools_version: main_build
clean: true
- name: Generate — openpipeline_composed (workflows)
uses: viash-io/viash-actions/pro/generate-documentation-qmd@v6
with:
project_directory: openpipeline_composed
query: '^workflows'
output_dir: ../openpipeline_docs/reference/openpipeline_composed/
dest_path: "{namespace}/{name}.qmd"
viash_pro_token: ${{ secrets.GTHB_PAT }}
tools_version: main_build
clean: false
- name: Open PR
working-directory: openpipeline_docs
env:
GITHUB_TOKEN: ${{ secrets.GTHB_PAT }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add reference
if git diff --cached --quiet; then
echo "Reference already up to date — nothing to propose."
exit 0
fi
BRANCH="reference/update-${{ inputs.ref || 'main' }}"
git checkout -B "$BRANCH"
git commit -m "Regenerate reference from ${{ inputs.ref || 'main' }}"
git push --force-with-lease --set-upstream origin "$BRANCH"
gh pr create --title "Regenerate reference (${{ inputs.ref || 'main' }})" \
--base main --head "$BRANCH" \
--body "Auto-generated from all five packages' Viash configs. Do not hand-edit \`reference/<package>/\`." \
|| echo "PR already open for $BRANCH; branch updated."