Deploy-Dashboard #664
This file contains 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"] | |
schedule: | |
- cron: 0 0,8,16 * * * | |
workflow_dispatch: | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build-deploy-site: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup env | |
uses: ./.github/actions/common/setup-env | |
with: | |
free_up_space: false | |
- name: Initalize gcc | |
run: | | |
cd riscv-gnu-toolchain | |
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: EndBug/add-and-commit@v9 | |
with: | |
message: 'CI: Update dashboard with latest runs' | |
add: 'dashboard' | |
# Deploy | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: './dashboard/site' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |