Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
pages: write
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -73,10 +69,6 @@ jobs:
runs-on: ubuntu-latest
name: Deploy Docs

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -102,13 +94,6 @@ jobs:
${{ runner.os }}-turbo-

- name: Build docs
env:
ZE_CI_TOKEN: ${{ secrets.ZE_CI_TOKEN }}
run: pnpm turbo build -F @kitajs/docs-html

- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: packages/docs/dist

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
53 changes: 53 additions & 0 deletions .github/workflows/preview-environments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Zephyr Preview Environments

on:
pull_request:
types: [opened, synchronize, reopened, closed]

permissions:
contents: read
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
preview:
runs-on: ubuntu-latest
name: Preview Docs

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup node and restore cached dependencies
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install packages
run: pnpm install --frozen-lockfile

- name: Cache turbo build setup
uses: actions/cache@v5
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Build docs
if: ${{ github.event.action != 'closed' }}
env:
ZE_CI_TOKEN: ${{ secrets.ZE_CI_TOKEN }}
run: pnpm turbo build -F @kitajs/docs-html

- name: Zephyr Preview Environments
uses: ZephyrCloudIO/zephyr-preview-environment-action@v0.2.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"shiki": "^4.0.2",
"typescript": "catalog:",
"unified": "^11.0.5",
"unist-util-visit": "^5.1.0"
"unist-util-visit": "^5.1.0",
"zephyr-rspress-plugin": "^1.1.2"
}
}
2 changes: 2 additions & 0 deletions packages/docs/rspress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import pluginFileTree from 'rspress-plugin-file-tree'
import pluginOg from 'rspress-plugin-og'
import readingTime from 'rspress-plugin-reading-time'
import ts from 'typescript'
import { withZephyr } from 'zephyr-rspress-plugin'
import { remarkKitaPlugin } from './plugins/kita/remarkPlugin'

/** Shared TypeDoc setup for compact, public-only API docs. */
Expand Down Expand Up @@ -64,6 +65,7 @@ export default defineConfig({
},

plugins: [
withZephyr(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the deployment process to work, you will need to add ZE_CI_TOKEN to the list of turbo.json environment variables to pass on to the execution layer.

readingTime(),
pluginTwoslash({
twoslashOptions: {
Expand Down
Loading
Loading