Deploy-Dashboard #151
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-Dashboard | |
| on: | |
| push: | |
| branches: ["main"] | |
| paths-ignore: | |
| - "dashboard/**" | |
| schedule: | |
| - cron: 0 0,8,16 * * * | |
| workflow_dispatch: | |
| # Serialize dashboard deployments on the same ref to reduce auto-commit push races. | |
| # Dashboard-only auto-commits are ignored by the push trigger below, so they do not | |
| # immediately retrigger this workflow. | |
| concurrency: | |
| group: deploy-dashboard-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-deploy-site: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup env | |
| uses: ./.github/actions/common/setup-env | |
| with: | |
| free_up_space: false | |
| - name: Initalize gcc | |
| id: init | |
| run: | | |
| cd riscv-gnu-toolchain | |
| git submodule update --init gcc | |
| git fetch | |
| git reset --hard origin/build-frequent | |
| cd gcc | |
| git fetch | |
| continue-on-error: true | |
| - name: Initalize gcc | |
| if: ${{ steps.init.outcome == 'failure' }} | |
| run: | | |
| echo "Failed to initialize gcc. Retrying in 1 min" | |
| sleep 60 | |
| cd riscv-gnu-toolchain | |
| git fetch | |
| git reset --hard origin/build-frequent | |
| git submodule update --init gcc | |
| cd gcc | |
| git fetch | |
| - name: Bump pyopenssl and crypto | |
| run: | | |
| sudo apt remove python3-pip | |
| wget https://bootstrap.pypa.io/get-pip.py | |
| sudo python3 get-pip.py | |
| pip install -U pyopenssl cryptography | |
| - name: Get new data | |
| run: | | |
| pip install pygithub requests | |
| cd dashboard | |
| python getdata.py -token ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build site | |
| run: | | |
| pip install pandas plotly | |
| cd dashboard | |
| python plot.py | |
| - name: Commit new data/site | |
| uses: stefanzweifel/git-auto-commit-action@v6 | |
| with: | |
| commit_message: 'CI: Update dashboard with latest runs' | |
| file_pattern: 'dashboard/*' | |
| # Deploy | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './dashboard/site' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |