Skip to content

Commit 5eb157d

Browse files
jeremymanningclaude
andcommitted
Add GitHub Actions workflow for content building
Automatically builds HTML pages when: - Spreadsheet data files change (data/*.xlsx) - Templates change (templates/*.html) - Build scripts change (scripts/*.py) The workflow: 1. Validates all data files 2. Builds HTML pages from templates 3. Runs all tests 4. Commits updated HTML if changes detected (push to main only) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent a4df950 commit 5eb157d

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build Content Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'data/**'
9+
- 'templates/**'
10+
- 'scripts/**'
11+
pull_request:
12+
branches:
13+
- main
14+
paths:
15+
- 'data/**'
16+
- 'templates/**'
17+
- 'scripts/**'
18+
workflow_dispatch: # Allow manual triggering
19+
20+
jobs:
21+
validate-and-build:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: '3.11'
32+
cache: 'pip'
33+
34+
- name: Install dependencies
35+
run: pip install -r requirements-build.txt
36+
37+
- name: Validate data files
38+
working-directory: scripts
39+
run: python validate_data.py
40+
41+
- name: Build HTML pages
42+
working-directory: scripts
43+
run: python build.py
44+
45+
- name: Run tests
46+
run: python -m pytest tests/ -v
47+
48+
- name: Check for changes
49+
id: check_changes
50+
run: |
51+
if [[ -n $(git status --porcelain *.html) ]]; then
52+
echo "changes=true" >> $GITHUB_OUTPUT
53+
else
54+
echo "changes=false" >> $GITHUB_OUTPUT
55+
fi
56+
57+
- name: Commit and push changes
58+
if: github.event_name == 'push' && steps.check_changes.outputs.changes == 'true'
59+
run: |
60+
git config user.name 'github-actions[bot]'
61+
git config user.email 'github-actions[bot]@users.noreply.github.com'
62+
git add publications.html people.html software.html
63+
git commit -m "Auto-build: Update content pages from spreadsheet data"
64+
git push

0 commit comments

Comments
 (0)