-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (75 loc) · 2.46 KB
/
Copy pathsync-pstack.yml
File metadata and controls
89 lines (75 loc) · 2.46 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
name: Sync pstack changelog
on:
schedule:
- cron: '0 9 * * 1'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
sync:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Poll upstream pstack changes
id: sync
run: python3 .github/scripts/sync-pstack.py 2>&1 | tee sync.log
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate AI-friendly site files
run: python3 .github/scripts/generate.py
- name: Sync summary
if: always()
run: |
echo '### pstack sync summary' >> "$GITHUB_STEP_SUMMARY"
if [ -f sync.log ]; then
cat sync.log >> "$GITHUB_STEP_SUMMARY"
fi
if grep -q 'Warning:' sync.log 2>/dev/null; then
echo '' >> "$GITHUB_STEP_SUMMARY"
echo 'Warning: Sync completed with warnings. Review the log above to ensure no commits were missed.' >> "$GITHUB_STEP_SUMMARY"
fi
- name: Check for changes
id: changes
run: |
if git diff --quiet --exit-code; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push generated files
if: steps.changes.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add changelog.json changelog.html changelog.md llms-full.txt
git commit -m "chore: sync pstack changelog and regenerate AI files"
git push
- name: Setup Pages
if: steps.changes.outputs.changed == 'true'
uses: actions/configure-pages@v5
- name: Upload artifact
if: steps.changes.outputs.changed == 'true'
uses: actions/upload-pages-artifact@v3
with:
path: .
- name: Deploy to GitHub Pages
if: steps.changes.outputs.changed == 'true'
id: deployment
uses: actions/deploy-pages@v4