Squashed commit of the following: #9
Workflow file for this run
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: Build and Deploy PDF Index | |
| on: | |
| push: | |
| paths: | |
| - "results/**/*.pdf" | |
| - ".github/workflows/page.yaml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Generate index.html with grouped & sorted PDFs | |
| run: | | |
| mkdir -p output | |
| echo '<!DOCTYPE html><html><head><meta charset="utf-8"><title>Benchmark Results</title></head><body>' > output/index.html | |
| echo '<h1>Benchmark Results</h1>' >> output/index.html | |
| # Find all subdirs in results | |
| for dir in $(find results -mindepth 1 -maxdepth 1 -type d | sort); do | |
| name=$(basename "$dir") | |
| echo "<h2>${name}</h2><ul>" >> output/index.html | |
| # Sort PDFs in dir by modification time descending | |
| find "$dir" -name '*.pdf' -type f -printf '%T@ %p\n' | sort -nr | cut -d' ' -f2- | while read -r file; do | |
| echo "<li><a href='${file}'>$(basename "$file")</a></li>" >> output/index.html | |
| mkdir -p "output/$(dirname "$file")" | |
| cp "$file" "output/$file" | |
| done | |
| echo '</ul>' >> output/index.html | |
| done | |
| echo '</body></html>' >> output/index.html | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: output | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |