|
| 1 | +# GitHub Pages Deployment Guide |
| 2 | + |
| 3 | +This document outlines the steps to deploy the Butler Sheet Icons documentation to GitHub Pages with the custom domain `bsi.ptarmiganlabs.com`. |
| 4 | + |
| 5 | +## Automated Steps (npm scripts) |
| 6 | + |
| 7 | +The following npm scripts have been added for automated deployment: |
| 8 | + |
| 9 | +```bash |
| 10 | +# Build and deploy in one command |
| 11 | +npm run deploy |
| 12 | + |
| 13 | +# Or run steps separately: |
| 14 | +npm run deploy:build # Build the documentation site |
| 15 | +npm run deploy:publish # Deploy to gh-pages branch |
| 16 | +``` |
| 17 | + |
| 18 | +## Manual Setup Required |
| 19 | + |
| 20 | +### 1. DNS Configuration |
| 21 | + |
| 22 | +You need to create a CNAME record in your DNS provider (ptarmiganlabs.com): |
| 23 | + |
| 24 | +- **Record Type**: CNAME |
| 25 | +- **Name**: `bsi` (creates bsi.ptarmiganlabs.com) |
| 26 | +- **Value**: `ptarmiganlabs.github.io` |
| 27 | +- **TTL**: 300 seconds (or your preferred value) |
| 28 | + |
| 29 | +### 2. GitHub Repository Settings |
| 30 | + |
| 31 | +In the GitHub repository settings: |
| 32 | + |
| 33 | +1. Go to **Settings** → **Pages** |
| 34 | +2. Under **Source**, select "Deploy from a branch" |
| 35 | +3. Select **Branch**: `gh-pages` and **Folder**: `/ (root)` |
| 36 | +4. Under **Custom domain**, enter: `bsi.ptarmiganlabs.com` |
| 37 | +5. Check **Enforce HTTPS** (recommended) |
| 38 | +6. Save the settings |
| 39 | + |
| 40 | +### 3. First Deployment |
| 41 | + |
| 42 | +After the manual setup is complete: |
| 43 | + |
| 44 | +1. Run `npm run deploy` to build and deploy the site |
| 45 | +2. Wait for GitHub to process the deployment (usually 1-5 minutes) |
| 46 | +3. Verify the site is accessible at https://bsi.ptarmiganlabs.com |
| 47 | + |
| 48 | +## Files Configured |
| 49 | + |
| 50 | +- **CNAME file**: Located at `docs/public/CNAME` (contains `bsi.ptarmiganlabs.com`) |
| 51 | +- **.nojekyll file**: Located at `docs/public/.nojekyll` (tells GitHub Pages to skip Jekyll processing) |
| 52 | +- **Package.json**: Updated with deployment scripts |
| 53 | +- **gh-pages package**: Added as dev dependency for deployment |
| 54 | + |
| 55 | +## Troubleshooting |
| 56 | + |
| 57 | +### DNS Issues |
| 58 | +- DNS propagation can take up to 24 hours |
| 59 | +- Use tools like `dig` or online DNS checkers to verify the CNAME record |
| 60 | +- Test with `dig bsi.ptarmiganlabs.com` - should return `ptarmiganlabs.github.io` |
| 61 | + |
| 62 | +### GitHub Pages Issues |
| 63 | +- Check the **Actions** tab for deployment status |
| 64 | +- Ensure the `gh-pages` branch exists and contains the built files |
| 65 | +- Verify the custom domain is correctly configured in repository settings |
| 66 | + |
| 67 | +### Build Issues |
| 68 | +- Run `npm run docs:build` locally to test the build |
| 69 | +- Check that `docs/.vitepress/dist/` contains the CNAME file after building |
| 70 | +- Ensure all dependencies are installed with `npm install` |
| 71 | + |
| 72 | +## Alternative: GitHub Actions |
| 73 | + |
| 74 | +Instead of using npm scripts, you can set up GitHub Actions for automatic deployment on every push to main. See the README.md for the workflow configuration. |
0 commit comments