Skip to content

Merge pull request #204 from pyOpenSci/contribs #487

Merge pull request #204 from pyOpenSci/contribs

Merge pull request #204 from pyOpenSci/contribs #487

Workflow file for this run

name: Deploy Metrics Book
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Run every Sunday @ midnight (UTC)
pull_request:
push:
branches:
- main
env:
# `BASE_URL` determines the website is served from, including CSS & JS assets
# You may need to change this to `BASE_URL: ''`
BASE_URL: /${{ github.event.repository.name }}
# 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:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Repo
with:
persist-credentials: false
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- name: Sync dependencies
run: uv sync --frozen --no-dev
- name: Add project venv to PATH
run: echo "${{ github.workspace }}/.venv/bin" >> "$GITHUB_PATH"
- name: Setup Quarto
uses: quarto-dev/quarto-actions/setup@8a96df13519ee81fd526f2dfca5962811136661b # v2
with:
version: "release"
- name: Render dashboard website
uses: quarto-dev/quarto-actions/render@8a96df13519ee81fd526f2dfca5962811136661b # v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
# Only deploy on pyOpenSci owned repo / when pushed to main branch
deploy:
needs: build
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
if: |
github.ref == 'refs/heads/main' &&
github.repository_owner == 'pyOpenSci' &&
github.event_name == 'push'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0