Documentation Deployment Guide
This guide explains how to deploy the ScriptIt documentation site.
Overview
The documentation is built with VitePress and can be deployed to any static hosting service.
Local Development
bash
# Install dependencies
bun install
# Start development server
bun run docs:dev
# Build for production
bun run docs:build
# Preview production build
bun run docs:previewDeployment Options
GitHub Pages
- Setup GitHub Actions (recommended):
Create .github/workflows/docs.yml:
yaml
name: Deploy Documentation
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: bun install
- name: Build documentation
run: bun run docs:build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4- Enable GitHub Pages in repository settings:
- Go to Settings > Pages
- Source: GitHub Actions
Netlify
- Connect repository to Netlify
- Build settings:
- Build command:
bun run docs:build - Publish directory:
docs/.vitepress/dist
- Build command:
- Environment variables:
NODE_VERSION:18
Vercel
- Connect repository to Vercel
- Build settings:
- Framework Preset: Other
- Build Command:
bun run docs:build - Output Directory:
docs/.vitepress/dist - Install Command:
bun install
Cloudflare Pages
- Connect repository to Cloudflare Pages
- Build settings:
- Build command:
bun run docs:build - Build output directory:
docs/.vitepress/dist - Environment variables:
NODE_VERSION:18
- Build command:
Custom Domain
To use a custom domain:
Add CNAME file in
docs/public/CNAME:docs.scriptit.devConfigure DNS to point to your hosting provider
Update base URL in
docs/.vitepress/config.tsif needed:typescriptexport default defineConfig({ base: '/', // or '/subdirectory/' if deploying to a subdirectory // ... other config })
Build Optimization
Performance Tips
- Enable compression in hosting provider
- Use CDN for faster global delivery
- Optimize images in
docs/public/ - Enable caching for static assets
SEO Optimization
- Update meta tags in
docs/.vitepress/config.ts - Add sitemap (VitePress generates automatically)
- Submit to search engines
- Add structured data if needed
Monitoring
Analytics
Add analytics to docs/.vitepress/config.ts:
typescript
export default defineConfig({
head: [
// Google Analytics
['script', { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID' }],
['script', {}, `window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');`]
],
// ... other config
})Error Monitoring
Consider adding error monitoring services like:
- Sentry
- LogRocket
- Bugsnag
Maintenance
Regular Tasks
Update dependencies:
bashbun updateCheck for broken links:
bash# Remove ignoreDeadLinks from config temporarily bun run docs:buildUpdate content:
- Version numbers in examples
- Screenshots if UI changes
- API documentation
- Changelog
Performance audit:
- Lighthouse scores
- Bundle size analysis
- Loading times
Version Updates
When releasing a new ScriptIt version:
- Update version in
docs/.vitepress/config.ts - Update changelog
- Update examples with new features
- Add migration guides if needed
- Update homepage features
Troubleshooting
Common Issues
Build fails with dead links:
- Check all internal links
- Temporarily enable
ignoreDeadLinks: true
Images not loading:
- Ensure images are in
docs/public/ - Use absolute paths:
/image.png
- Ensure images are in
Styles not applying:
- Check CSS syntax
- Verify custom CSS imports
Search not working:
- Ensure
search.provider: 'local'is set - Check if content is being indexed
- Ensure
Debug Mode
Enable debug mode for troubleshooting:
bash
DEBUG=vitepress:* bun run docs:buildSupport
For deployment issues: