Update GitHub Actions workflows to latest action versions and improve pnpm usage by introducing per-package workspace configs. Add docs-site/pnpm-workspace.yaml and update Dockerfile/package.json for better monorepo support. Upgrade dependencies across main and docs-site packages for compatibility and security. Refine TypeScript types and hooks for improved type safety and maintainability.
79 lines
1.9 KiB
YAML
79 lines
1.9 KiB
YAML
name: Docs Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
release:
|
|
types: [published, edited, deleted]
|
|
workflow_run:
|
|
workflows: ["Version Docs on Tag"]
|
|
types: [completed]
|
|
workflow_dispatch:
|
|
inputs:
|
|
full_reconcile:
|
|
description: 'Run full changelog reconcile from GitHub Releases'
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: docs-pages
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
ref: main
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: lts/*
|
|
cache: pnpm
|
|
cache-dependency-path: docs-site/pnpm-lock.yaml
|
|
|
|
- name: Install docs dependencies
|
|
working-directory: docs-site
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build changelog feed
|
|
env:
|
|
CHANGELOG_PUBLIC_BASE_URL: https://docs.openreader.richardr.dev
|
|
CHANGELOG_FORCE_FULL: ${{ github.event_name == 'workflow_dispatch' && inputs.full_reconcile && '1' || '0' }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: node scripts/build-changelog-feed.mjs
|
|
|
|
- name: Build docs
|
|
working-directory: docs-site
|
|
run: pnpm build
|
|
|
|
- name: Upload Pages artifact
|
|
uses: actions/upload-pages-artifact@v5
|
|
with:
|
|
path: docs-site/build
|
|
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v5
|