Deploy Performance Graph #671
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: Deploy Performance Graph | |
| on: | |
| workflow_run: | |
| workflows: ["Picofuzz Tests"] | |
| types: [completed] | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| workflow_run_id: | |
| description: Workflow run ID which contains CSV artifacts. | |
| required: true | |
| type: string | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: ./perf-graph | |
| - name: Download picofuzz CSV artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: picofuzz-csv-* | |
| path: ./csv-artifacts | |
| github-token: ${{ secrets.ARTIFACTS_PAT }} | |
| merge-multiple: true | |
| run-id: ${{ github.event.workflow_run.id || inputs.workflow_run_id }} | |
| continue-on-error: true | |
| - name: Copy CSV files to public directory | |
| run: | | |
| # Create public directory if it doesn't exist | |
| mkdir -p ./perf-graph/public | |
| # Copy CSV files from artifacts if they exist | |
| if [ -d "./csv-artifacts" ]; then | |
| echo "Copying CSV files from artifacts..." | |
| cp ./csv-artifacts/*.csv ./perf-graph/public/ 2>/dev/null || echo "No CSV files found in artifacts" | |
| fi | |
| # List what's in public directory | |
| echo "Files in public directory:" | |
| ls -la ./perf-graph/public/ | |
| - name: Build project | |
| run: npm run build | |
| working-directory: ./perf-graph | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./perf-graph/dist | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |