Refresh data and deploy Pages #135
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: Refresh data and deploy Pages | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "17 */6 * * *" | |
| workflow_dispatch: | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| quality: | |
| if: github.event_name != 'schedule' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: npm | |
| - run: npm ci | |
| - run: npx playwright install --with-deps chromium | |
| - name: Test collector | |
| run: python -m unittest discover -s tests -v | |
| - name: Test frontend logic | |
| run: npm test | |
| - name: Type-check and build | |
| run: npm run build | |
| - name: Test production site | |
| run: npm run test:e2e | |
| - name: Upload Playwright report | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 7 | |
| collect: | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| models: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Test collector | |
| run: python -m unittest discover -s tests -v | |
| - name: Refresh project data | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: python -m collector | |
| - name: Commit valid data | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add public/data/site.json data/catalog.json data/translations.json data/projects data/history | |
| git diff --cached --quiet || git commit -m "data: refresh capability radar" | |
| git push | |
| deploy: | |
| needs: [quality, collect] | |
| if: >- | |
| always() && | |
| github.event_name != 'pull_request' && | |
| (needs.quality.result == 'success' || needs.quality.result == 'skipped') && | |
| (needs.collect.result == 'success' || needs.collect.result == 'skipped') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: main | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build | |
| - uses: actions/configure-pages@v5 | |
| - uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: dist | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |