Skip to content

Commit 2deeacb

Browse files
committed
📚 Add VitePress documentation site with GitHub Pages deployment
Replace flat markdown docs with a structured VitePress documentation site featuring guide, API reference, and examples sections. Includes: - VitePress configuration with custom SilkCircuit theme - GitHub Actions workflow for automated deployment to Pages - Organized navigation: Getting Started, Core Concepts, Advanced, Deployment - Complete API documentation for env(), requireEnv(), parsers, and components - App Router examples for both script and context approaches Removes legacy standalone markdown files (GETTING_STARTED.md, EXPOSING_CUSTOM_ENV.md, MAKING_ENV_PUBLIC.md, MIGRATION.md) as content has been reorganized into the new structure.
1 parent d2eadc9 commit 2deeacb

31 files changed

Lines changed: 6496 additions & 502 deletions

.github/workflows/docs.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: 📚 Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main, development]
6+
paths:
7+
- 'docs/**'
8+
- '.github/workflows/docs.yml'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
22+
# 🏗️ Build Documentation
23+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
24+
build:
25+
name: 🏗️ Build Docs
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: 📥 Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- name: 📦 Setup pnpm
34+
uses: pnpm/action-setup@v4
35+
with:
36+
version: 10
37+
38+
- name: 🔧 Setup Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 22
42+
cache: 'pnpm'
43+
cache-dependency-path: 'docs/pnpm-lock.yaml'
44+
45+
- name: 📚 Install dependencies
46+
working-directory: docs
47+
run: pnpm install --frozen-lockfile
48+
49+
- name: 🏗️ Build VitePress
50+
working-directory: docs
51+
run: pnpm build
52+
53+
- name: 📤 Upload artifact
54+
uses: actions/upload-pages-artifact@v3
55+
with:
56+
path: docs/.vitepress/dist
57+
58+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
59+
# 🚀 Deploy to GitHub Pages
60+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
61+
deploy:
62+
name: 🚀 Deploy to Pages
63+
environment:
64+
name: github-pages
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
needs: build
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: 🚀 Deploy to GitHub Pages
70+
id: deployment
71+
uses: actions/deploy-pages@v4
72+
73+
- name: ✅ Deployment Summary
74+
run: |
75+
echo "### 📚 Documentation Deployed" >> $GITHUB_STEP_SUMMARY
76+
echo "" >> $GITHUB_STEP_SUMMARY
77+
echo "**URL:** ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY
78+
echo "" >> $GITHUB_STEP_SUMMARY
79+
echo "🎉 VitePress documentation is now live!" >> $GITHUB_STEP_SUMMARY

docs/.vitepress/config.ts

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
export default defineConfig({
4+
title: 'next-dynenv',
5+
description: 'Dynamic runtime environment variables for Next.js',
6+
base: '/next-dynenv/',
7+
8+
head: [
9+
['meta', { name: 'theme-color', content: '#e135ff' }],
10+
['meta', { property: 'og:type', content: 'website' }],
11+
['meta', { property: 'og:title', content: 'next-dynenv Documentation' }],
12+
['meta', { property: 'og:description', content: 'Dynamic runtime environment variables for Next.js' }],
13+
],
14+
15+
themeConfig: {
16+
nav: [
17+
{ text: 'Guide', link: '/guide/' },
18+
{ text: 'API', link: '/api/' },
19+
{ text: 'Examples', link: '/examples/' },
20+
],
21+
22+
sidebar: {
23+
'/guide/': [
24+
{
25+
text: 'Getting Started',
26+
items: [
27+
{ text: 'Introduction', link: '/guide/' },
28+
{ text: 'Installation', link: '/guide/installation' },
29+
{ text: 'Quick Start', link: '/guide/quick-start' },
30+
],
31+
},
32+
{
33+
text: 'Core Concepts',
34+
items: [
35+
{ text: 'How It Works', link: '/guide/how-it-works' },
36+
{ text: 'Script Approach', link: '/guide/script-approach' },
37+
{ text: 'Context Approach', link: '/guide/context-approach' },
38+
],
39+
},
40+
{
41+
text: 'Advanced',
42+
items: [
43+
{ text: 'Custom Variables', link: '/guide/custom-variables' },
44+
{ text: 'Making Env Public', link: '/guide/making-env-public' },
45+
{ text: 'Security', link: '/guide/security' },
46+
],
47+
},
48+
{
49+
text: 'Deployment',
50+
items: [
51+
{ text: 'Docker', link: '/guide/docker' },
52+
{ text: 'Vercel', link: '/guide/vercel' },
53+
{ text: 'Other Platforms', link: '/guide/other-platforms' },
54+
],
55+
},
56+
],
57+
'/api/': [
58+
{
59+
text: 'API Reference',
60+
items: [
61+
{ text: 'Overview', link: '/api/' },
62+
{ text: 'env()', link: '/api/env' },
63+
{ text: 'requireEnv()', link: '/api/require-env' },
64+
{ text: 'envParsers', link: '/api/parsers' },
65+
{ text: 'Components', link: '/api/components' },
66+
],
67+
},
68+
],
69+
'/examples/': [
70+
{
71+
text: 'Examples',
72+
items: [
73+
{ text: 'Overview', link: '/examples/' },
74+
{ text: 'App Router (Script)', link: '/examples/app-router-script' },
75+
{ text: 'App Router (Context)', link: '/examples/app-router-context' },
76+
],
77+
},
78+
],
79+
},
80+
81+
socialLinks: [{ icon: 'github', link: 'https://github.com/hyperb1iss/next-dynenv' }],
82+
83+
footer: {
84+
message: 'Released under the MIT License.',
85+
copyright: 'Copyright © 2024-2025 Stefanie Jane',
86+
},
87+
88+
search: {
89+
provider: 'local',
90+
},
91+
},
92+
93+
markdown: {
94+
theme: {
95+
light: 'github-light',
96+
dark: 'one-dark-pro',
97+
},
98+
},
99+
})

docs/.vitepress/theme/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { Theme } from 'vitepress'
2+
import DefaultTheme from 'vitepress/theme'
3+
import './silkcircuit.css'
4+
5+
export default {
6+
extends: DefaultTheme,
7+
} satisfies Theme

0 commit comments

Comments
 (0)