Update dashboard #398
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 dashboard | |
| on: | |
| schedule: | |
| - cron: "*/5 * * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| update: | |
| name: Collect and deploy | |
| runs-on: ubuntu-latest | |
| env: | |
| DASHBOARD_GITHUB_TOKEN: ${{ secrets.DASHBOARD_GITHUB_TOKEN }} | |
| steps: | |
| - name: Skip when dashboard token is missing | |
| if: ${{ env.DASHBOARD_GITHUB_TOKEN == '' }} | |
| run: echo "DASHBOARD_GITHUB_TOKEN is not configured; skipping dashboard refresh." | |
| - name: Checkout | |
| if: ${{ env.DASHBOARD_GITHUB_TOKEN != '' }} | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| if: ${{ env.DASHBOARD_GITHUB_TOKEN != '' }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Collect dashboard data | |
| if: ${{ env.DASHBOARD_GITHUB_TOKEN != '' }} | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| REQUIRE_RUNNER_STATUS: "true" | |
| TARGET_REPO: dartsim/dart | |
| SITE_BASE_URL: https://dartsim.github.io/ci-status/ | |
| run: python scripts/collect.py | |
| - name: Publish generated site | |
| if: ${{ env.DASHBOARD_GITHUB_TOKEN != '' }} | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: | | |
| cd public | |
| touch .nojekyll | |
| git init -b gh-pages | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "Update dashboard" | |
| git remote add origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | |
| git push --force origin gh-pages |