Skip to content

Commit 4f694bb

Browse files
hoomanclaude
andcommitted
Add publish-briefs workflow for website deployment
Triggers on changes to data/briefs/, templates, or build scripts. Builds brief markdown and PDF bundle, then pushes to the IranTransitionProject.github.io repo's briefs/downloads/ directory. Requires WEBSITE_DEPLOY_TOKEN secret with write access to the website repo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 54cb6c9 commit 4f694bb

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Publish Briefs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'data/briefs/**'
8+
- 'templates/brief.md.j2'
9+
- 'pipeline/build_briefs.py'
10+
- 'pipeline/build_pdf.py'
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
build-and-publish:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout framework
21+
uses: actions/checkout@v4
22+
23+
- name: Checkout website repo
24+
uses: actions/checkout@v4
25+
with:
26+
repository: IranTransitionProject/IranTransitionProject.github.io
27+
path: _website
28+
token: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
29+
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: '3.11'
34+
35+
- name: Install dependencies
36+
run: |
37+
pip install -r requirements.txt
38+
pip install weasyprint
39+
40+
- name: Build brief markdown files
41+
run: python pipeline/build_briefs.py
42+
43+
- name: Build PDF bundle
44+
run: python pipeline/build_pdf.py --tier briefs
45+
46+
- name: Copy outputs to website
47+
run: |
48+
mkdir -p _website/briefs/downloads
49+
cp output/briefs/*.md _website/briefs/downloads/
50+
cp releases/ITP-Briefs-*.pdf _website/briefs/downloads/ 2>/dev/null || true
51+
52+
- name: Commit and push to website
53+
working-directory: _website
54+
run: |
55+
git config user.name "github-actions[bot]"
56+
git config user.email "github-actions[bot]@users.noreply.github.com"
57+
git add briefs/downloads/
58+
if ! git diff --cached --quiet; then
59+
git commit -m "Update briefs from framework $(git -C .. rev-parse --short HEAD)"
60+
git push
61+
else
62+
echo "No brief changes to publish"
63+
fi

0 commit comments

Comments
 (0)