Files
alchemist/.github/workflows/docs.yml

91 lines
2.1 KiB
YAML

name: Docs
on:
push:
branches:
- master
paths:
- 'docs/**'
- 'src/css/**'
- 'static/**'
- 'docusaurus.config.ts'
- 'sidebars.ts'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '.github/workflows/docs.yml'
- '.github/workflows/build.yml'
pull_request:
paths:
- 'docs/**'
- 'src/css/**'
- 'static/**'
- 'docusaurus.config.ts'
- 'sidebars.ts'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '.github/workflows/docs.yml'
- '.github/workflows/build.yml'
workflow_dispatch:
concurrency:
group: docs-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
build-docs:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Build docs site
env:
DOCS_URL: https://bybrooklyn.github.io
DOCS_BASE_URL: /alchemist/
run: npm run build
- name: Upload built site artifact
uses: actions/upload-artifact@v4
with:
name: docs-site-${{ github.run_id }}
path: build
retention-days: 7
- name: Upload GitHub Pages artifact
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v3
with:
path: build
deploy:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
needs: [build-docs]
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@v4