Update Data and Deploy to GitHub Pages #146
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: Update Data and Deploy to GitHub Pages | |
| on: | |
| # Run twice daily at 6:00 AM and 6:00 PM UTC | |
| schedule: | |
| - cron: '0 6 * * *' | |
| - cron: '0 18 * * *' | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| # Also run on push to main (for code changes) | |
| push: | |
| branches: ['main'] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: 'pages' | |
| cancel-in-progress: true | |
| jobs: | |
| fetch-data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Python dependencies | |
| run: pip install requests | |
| - name: Fetch Jira data | |
| env: | |
| JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} | |
| JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} | |
| run: | | |
| python get-rvg-issues.py --output grouped-csv --save public/rvg-grouped.csv | |
| - name: Upload CSV artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rvg-data | |
| path: public/rvg-grouped.csv | |
| retention-days: 1 | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: fetch-data | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download CSV artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: rvg-data | |
| path: public/ | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './dist' | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |