Skip to content

Use self-repository syntax for composite actions #68

Use self-repository syntax for composite actions

Use self-repository syntax for composite actions #68

Workflow file for this run

name: Documentation
on:
push:
branches:
- main
pull_request:
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3
permissions:
contents: read
jobs:
# Runs on every trigger, so a pull request proves the site still builds
# before it is merged. The Pages steps are the only ones that need Pages
# permissions, so they are skipped for pull requests -- a fork pull request
# gets a read-only token and could not run them anyway.
build:
name: Build docs
permissions:
contents: read
pages: read # actions/configure-pages reads the Pages site config
runs-on: ubuntu-latest
steps:
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
if: github.event_name != 'pull_request'
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.x
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
enable-cache: false
- name: Install package
run: uv sync
- run: uv run zensical build --clean
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
if: github.event_name != 'pull_request'
with:
path: site
deploy:
name: Deploy docs
needs: [build]
if: github.event_name != 'pull_request'
permissions:
pages: write # deploy the built site to GitHub Pages
id-token: write # required by actions/deploy-pages for OIDC
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
id: deployment