-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.52 KB
/
pages.yml
File metadata and controls
54 lines (45 loc) · 1.52 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
name: Generate and Deploy to GitHub Pages
on:
push:
branches: [ main ]
paths:
- 'Graph Analysis/unified_analysis.py'
- 'reports/unified_analysis_report_explained.md'
- 'docs/script.js'
- 'docs/style.css'
- '.github/workflows/pages.yml'
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
jobs:
generate-and-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate HTML report
run: |
python "Graph Analysis/unified_analysis.py" --html --html-output docs/index.html
- name: Commit and push if changed
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git add docs/index.html docs/script.js docs/style.css
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Auto-update HTML report and assets"
git push origin HEAD:main
echo "Changes pushed. The static.yml workflow should now deploy to GitHub Pages."
fi