Skip to content

Commit

Permalink
add test version of docs deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
zoey-kaiser committed Jul 2, 2024
1 parent a4d7155 commit 1a32bfb
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy Docs

on:
push:
branches: [docs/migrate-to-vitepress] // TODO: Change to `main`

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# 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 job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to calculate lastUpdated
- uses: pnpm/action-setup@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Navigate to correct directory
run: cd docs/
- name: Install dependencies
run: pnpm ci
- name: Build with VitePress
run: pnpm docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
5 changes: 5 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default defineConfig({
title: 'NuxtAuth',
titleTemplate: ':title - by sidebase',
description: 'The productive way to build fullstack Nuxt 3 applications.',
base: '/nuxt-auth/', // TODO: Change once we deploy to offical domain
lang: 'en-US',
appearance: 'dark',
lastUpdated: true,
Expand All @@ -26,5 +27,9 @@ export default defineConfig({
search: {
provider: 'local',
},
editLink: {
pattern: 'https://github.com/sidebase/nuxt-auth/tree/main/docs/:path',
text: 'Edit this page on GitHub'
}
},
})

0 comments on commit 1a32bfb

Please sign in to comment.