Add publishing script #1
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: Publish Benchmark Results | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'results/**' | |
| - 'report/**' | |
| - '.github/workflows/publish-results.yml' | |
| workflow_dispatch: # Manual trigger | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| pip install plotly pandas kaleido # Ensure chart dependencies | |
| - name: Generate HTML Report | |
| run: | | |
| cd report | |
| python create_report.py | |
| - name: Prepare docs folder for GitHub Pages | |
| run: | | |
| mkdir -p docs | |
| cp report/report.html docs/index.html | |
| cp -r report/charts docs/charts 2>/dev/null || true | |
| cp -r static docs/static 2>/dev/null || true | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'docs/' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |