Refactor review submission process to streamline JSON download and re… #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 "[email protected]" | |
| 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 | |