This repository was archived by the owner on Sep 9, 2025. It is now read-only.
forked from FCP-INDI/C-PAC
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.75 KB
/
nodeblock_docs.yml
File metadata and controls
61 lines (52 loc) · 1.75 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
name: Update NodeBlock documentation
on:
push:
branches: [main]
jobs:
update-nodeblock-docs:
name: Update NodeBlock Documentation
runs-on: ubuntu-latest
steps:
# Check out the source repo
- name: Check out source repository (C-PAC)
uses: actions/checkout@v3
with:
path: source-repo
# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
# Run the documentation extraction script
- name: Generate documentation JSON
run: |
cd source-repo
python scripts/nodeblock_docs.py
# Check out the target repo where we want to commit the JSON file
- name: Check out target repository
uses: actions/checkout@v3
with:
repository: FCP-INDI/cpac-docs
path: target-repo
token: ${{ secrets.CPAC_DOC_REPO_ACCESS }}
# Install cpac dependencies
- name: Install dependencies
run: |
cd source-repo
python -m pip install --upgrade pip
pip install -r requirements.txt
# Run the config extraction script
- name: Generate documentation JSON
run: |
cd source-repo
python scripts/config_extractor.py
# Copy the JSON file to the target repo and commit it
- name: Commit documentation to target repo
run: |
cp source-repo/nodeblock_index.json target-repo/src
cd target-repo
git config user.name "GitHub Actions Bot"
git config user.email "actions@github.com"
git add nodeblock_index.json
git diff --quiet && git diff --staged --quiet || git commit -m "Update NodeBlock documentation"
git push