File tree Expand file tree Collapse file tree 1 file changed +16
-22
lines changed
Expand file tree Collapse file tree 1 file changed +16
-22
lines changed Original file line number Diff line number Diff line change 1111 workflow_dispatch : # Allow manual trigger
1212
1313permissions :
14- contents : read
15- pages : write
16- id-token : write
17-
18- concurrency :
19- group : " pages"
20- cancel-in-progress : false
14+ contents : write
2115
2216jobs :
23- generate-and-deploy :
17+ generate-and-commit :
2418 runs-on : ubuntu-latest
25- environment :
26- name : github-pages
27- url : ${{ steps.deployment.outputs.page_url }}
2819
2920 steps :
3021 - name : Checkout repository
3122 uses : actions/checkout@v4
23+ with :
24+ fetch-depth : 0
3225
3326 - name : Set up Python
3427 uses : actions/setup-python@v4
@@ -44,15 +37,16 @@ jobs:
4437 run : |
4538 python "Graph Analysis/unified_analysis.py" --html --html-output docs/index.html
4639
47- - name : Setup Pages
48- uses : actions/configure-pages@v3
49-
50- - name : Upload artifact
51- uses : actions/upload-pages-artifact@v2
52- with :
53- path : ' ./docs'
54-
55- - name : Deploy to GitHub Pages
56- id : deployment
57- uses : actions/deploy-pages@v2
40+ - name : Commit and push if changed
41+ run : |
42+ git config --local user.email "[email protected] " 43+ git config --local user.name "GitHub Action"
44+ git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
45+ git add docs/index.html docs/script.js docs/style.css
46+ if git diff --staged --quiet; then
47+ echo "No changes to commit"
48+ else
49+ git commit -m "Auto-update HTML report and assets [skip ci]"
50+ git push origin HEAD:main
51+ fi
5852
You can’t perform that action at this time.
0 commit comments