Skip to content

new-profiling-results #126

new-profiling-results

new-profiling-results #126

name: Build and Deploy Website
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
repository_dispatch:
types: [new-profiling-results]
permissions:
deployments: write
contents: write
concurrency:
# Skip build if a new build is triggered by new updates
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_website:
name: Build profiling website
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch source branch contents
run: |
git checkout results
git checkout -
- name: Setup Python
uses: actions/setup-python@v5.3.0
with:
python-version: '3.10'
cache: 'pip'
- name: Install Python requirements
run: pip install -r requirements.txt
- name: Build website from profiling results
run: python website_builder/builder.py -c -f results
- name: Upload the generated HTML
uses: actions/upload-artifact@v4
with:
name: website_html_${{ github.sha }}
path: build/*
retention-days: 1
# Only deploy the website when the workflow was triggered on main
# This allows the previous two jobs to be used as checks against PRs
deploy-website:
name: Deploy pages site
runs-on: ubuntu-latest
needs: [build_website]
if: github.ref_name == 'main' || github.event_name == 'repository_dispatch'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Fetch profiling results html
uses: actions/download-artifact@v4
with:
name: website_html_${{ github.sha }}
path: build/
# .nojekyll ensures GH pages with underscores work
- name: Create .nojekyll
run: touch build/.nojekyll
shell: bash
- name: Deploy website
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
branch: gh-pages
clean: True