name: Deploy GitHub Pages site

on:
  # Run manually, on demand, from the Actions tab ("Run workflow").
  workflow_dispatch:
  # Also deploy automatically when the site changes on the default branch.
  push:
    branches: [ "master" ]
    paths:
      - "docs/**"
      - ".github/workflows/pages.yml"

# Minimal permissions required to publish to GitHub Pages.
permissions:
  contents: read
  pages: write
  id-token: write

# Allow only one concurrent deployment; don't cancel an in-progress run.
concurrency:
  group: "pages"
  cancel-in-progress: false

jobs:
  deploy:
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Checkout code
        uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.2.2

      - name: Configure Pages
        uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0

      - name: Upload site artifact
        uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
        with:
          path: docs

      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
