Skip to content
Closed
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
68 changes: 68 additions & 0 deletions .github/workflows/branch-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Deploy VitePress site to GitHub Pages

on: pull_request

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
env:
BRANCH_NAME: ${{ github.ref_name }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled

- name: Install package manager (from package.json)
run: |
corepack enable
corepack install

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: Setup GitHub Pages
uses: actions/configure-pages@v4

- name: Install dependencies
run: yarn install

- name: Yarn audit
run: yarn audit

- name: Build with VitePress
env:
GENERATE_BUILD_SIZE_VISUALIZER: true
run: yarn build

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

deploy:
environment:
name: staging
url: ${{ steps.deployment.outputs.page_url }}staging
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 2 additions & 1 deletion packages/docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import process from 'node:process';
import { kebabCase } from 'change-case';
import { defineConfig } from 'vitepress';
import { getSidebarItems } from './theme/Shared/Config/Lib/getSidebarItems';

export default defineConfig({
base: '/flyonui-vue/',
base: `/flyonui-vue/${process.env.BRANCH_NAME === undefined ? '' : 'staging'}`,
rewrites: (id) => {
const format = '.md';

Expand Down