Skip to content
Merged
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
102 changes: 102 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Deploy Documentation to Production

on:
# Only manual trigger - no automatic triggers
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
default: 'production'
type: choice
options:
- production
- preview

jobs:
check-unauthorized:
runs-on: ubuntu-latest
if: github.actor != 'jacksongrove'
steps:
- name: Unauthorized deployment attempt
run: |
echo "❌ UNAUTHORIZED: Only the repository owner can deploy to production"
echo "👤 User: ${{ github.actor }}"
echo "📋 Branch: ${{ github.ref }}"
echo ""
echo "💡 If you're contributing to this project:"
echo " - Submit a pull request instead"
echo " - Documentation validation happens automatically on PRs"
echo " - Production deployments are restricted to the maintainer"
exit 1

deploy-to-production:
runs-on: ubuntu-latest
environment: production
# Only allow deployment from main branch by repo owner
if: github.ref == 'refs/heads/main' && github.actor == 'jacksongrove'
defaults:
run:
working-directory: docs
steps:
- name: Check authorization
run: |
echo "🔒 Production deployment authorized for: ${{ github.actor }}"
echo "📋 Branch: ${{ github.ref }}"
echo "🎯 Environment: ${{ github.event.inputs.environment }}"
echo "🚀 Deploying to: impossibly.dev/docs"

- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx_copybutton sphinx_rtd_theme impossibly

- name: Build documentation
run: |
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
python -m sphinx -b html source build/html

- name: Install Vercel CLI
run: npm install --global vercel@latest

- name: Deploy to Vercel
run: |
if [ "${{ github.event.inputs.environment }}" = "production" ]; then
vercel --token=${{ secrets.VERCEL_TOKEN }} --prod --yes
else
vercel --token=${{ secrets.VERCEL_TOKEN }} --yes
fi
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

- name: Production Deployment Summary
run: |
echo "🚀 PRODUCTION Deployment completed successfully!"
echo ""
echo "📊 Deployment Details:"
echo " • Environment: ${{ github.event.inputs.environment }}"
echo " • Branch: ${{ github.ref }}"
echo " • Deployed by: ${{ github.actor }}"
echo " • Timestamp: $(date)"
echo ""
echo "🌍 Live URLs:"
echo " • Production: https://impossibly.dev/docs"
echo " • Direct Vercel: Check Vercel dashboard"
echo ""
echo "📋 Workflow Summary:"
echo " • VALIDATION: Runs on all PRs and merges (free)"
echo " • PRODUCTION: Manual deployment only (this workflow)"
echo ""
echo "⚙️ Next Steps:"
echo " • Verify deployment at https://impossibly.dev/docs"
echo " • Update main site routing if needed"
65 changes: 0 additions & 65 deletions .github/workflows/docs.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/validate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Validate Documentation Build

on:
push:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/validate-docs.yml'
pull_request:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/validate-docs.yml'
# Allow manual trigger for testing
workflow_dispatch:

jobs:
validate-docs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx_copybutton sphinx_rtd_theme impossibly

- name: Build documentation
run: |
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
python -m sphinx -b html source build/html

- name: Check for build warnings
run: |
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
python -m sphinx -b html source build/html -W
continue-on-error: true

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: documentation-validation
path: docs/build/html
retention-days: 7
# Only upload on main branch to save storage
if: github.ref == 'refs/heads/main'

- name: Validation Summary
run: |
echo "📋 Documentation validation completed!"
echo "✅ Build successful"
echo "📁 Artifacts uploaded for review"
echo ""
echo "NOTE: This is a validation-only workflow."
echo "For production deployment, use the 'Deploy to Production' workflow."
Loading