mirror of
https://github.com/bybrooklyn/alchemist.git
synced 2026-04-18 01:43:34 -04:00
94 lines
2.1 KiB
YAML
94 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
|
|
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
|
|
|
jobs:
|
|
build-docs:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
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@v7
|
|
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@v4
|
|
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@v5
|