mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
88 lines
2.4 KiB
YAML
88 lines
2.4 KiB
YAML
name: Deploy Docs Site
|
|
permissions:
|
|
contents: read
|
|
on:
|
|
push:
|
|
branches: ['main']
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Docusaurus
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
actions: write
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
node-version: 22
|
|
cache: yarn
|
|
cache-dependency-path: yarn.lock
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
cache: yarn
|
|
cache-dependency-path: website/yarn.lock
|
|
- name: yarn install (root)
|
|
run: yarn install --immutable
|
|
# Root turbo cache
|
|
- name: Cache for Turbo
|
|
uses: rharkor/caching-for-turbo@v2.5.1
|
|
with:
|
|
cache-prefix: turbo-cache-
|
|
- name: Build all pkg
|
|
run: yarn build:type
|
|
- name: Build docs
|
|
run: yarn turbo build:doc --single-package
|
|
- run: yarn install --immutable
|
|
working-directory: ./website
|
|
# Website turbo cache
|
|
- name: Cache for Turbo
|
|
uses: rharkor/caching-for-turbo@v2.5.1
|
|
with:
|
|
cache-prefix: turbo-cache-website-
|
|
server-port: 41231
|
|
- name: Restore bundler cache
|
|
uses: actions/cache@v6
|
|
with:
|
|
key: ${{ runner.os }}-docusaurus-bundler-${{ github.sha }}
|
|
path: ./website/node_modules/.cache
|
|
restore-keys: |
|
|
${{ runner.os }}-docusaurus-bundler-
|
|
- name: Build website
|
|
run: yarn turbo build
|
|
working-directory: ./website
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v5
|
|
with:
|
|
path: ./website/build
|
|
typecheck:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-node@v7
|
|
with:
|
|
cache: yarn
|
|
cache-dependency-path: website/yarn.lock
|
|
- run: yarn install --immutable
|
|
working-directory: ./website
|
|
- run: yarn typecheck
|
|
working-directory: ./website
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
|
concurrency: deploy-site
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v5
|