1 Deployment Guide

1.1 Cloudflare Pages Deployment

1.1.1 Setup Process

  1. Connect GitHub repository to Cloudflare Pages
  2. Configure build settings:
    • Build command: quarto render
    • Build output directory: _site
    • Root directory: / (or subdirectory if needed)

1.1.2 Environment Variables

Set these in Cloudflare Pages dashboard:

QUARTO_VERSION=latest
NODE_VERSION=18

1.1.3 Build Configuration

Create .cloudflare/pages.yml:

build:
  command: quarto render
  output: _site
  environment_variables:
    QUARTO_VERSION: "latest"
    NODE_VERSION: "18"

deployment:
  compatibility_date: "2024-01-01"
  environment_variables:
    NODE_ENV: "production"

1.2 Access Control Setup

1.2.1 Cloudflare Access Configuration

  1. Navigate to Cloudflare Zero Trust dashboard
  2. Create application for internal docs domain
  3. Set up authentication:
    • Google Workspace SSO
    • Email domain verification
    • Multi-factor authentication

1.2.2 Access Policies

name: "Internal Documentation Access"
decision: "allow"
rules:
  - name: "Team Members"
    require:
      - email_domain: "yourcompany.com"
      - groups: ["developers", "management"]

1.3 Automated Deployment

1.3.1 GitHub Actions Workflow

name: Deploy to Cloudflare Pages
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: quarto-dev/quarto-actions/setup@v2
      - run: quarto render
      - uses: cloudflare/pages-action@1
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          projectName: internal-docs
          directory: _site

1.4 Rollback Procedures

1.4.1 Emergency Rollback

  1. Access Cloudflare Pages dashboard
  2. Navigate to deployments history
  3. Click “Rollback” on previous successful deployment
  4. Verify functionality after rollback

1.4.2 Planned Rollbacks

  1. Create hotfix branch from previous stable commit
  2. Deploy through normal CI/CD process
  3. Monitor for issues
  4. Document rollback reason and resolution