Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Factor out GitHub Pages build and deployment workflow (#363) #2

Factor out GitHub Pages build and deployment workflow (#363)

Factor out GitHub Pages build and deployment workflow (#363) #2

Workflow file for this run

name: Pages
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
generate:
name: Generate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
uses: ./.github/actions/setup
with:
cachixAuthToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- run: pnpm docgen
build:
name: Build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: generate
steps:
- name: Build pages Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./docs
destination: ./_site
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
deploy:
name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
permissions:
pages: write # To deploy to GitHub Pages
id-token: write # To verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2