/ DEPLOYMENT.md
DEPLOYMENT.md
  1  # Deployment Guide
  2  
  3  This document explains how to deploy the Lightning Node Setup Guides to GitHub Pages with a custom domain.
  4  
  5  ## Prerequisites
  6  
  7  - ✅ Repository renamed to `xjmzx.github.io`
  8  - ✅ Custom domain `ln.fizx.uk` configured in GitHub repository settings
  9  - ✅ CNAME DNS record pointing `ln.fizx.uk` to `xjmzx.github.io`
 10  - ✅ CNAME file in `/public/CNAME` containing `ln.fizx.uk`
 11  
 12  ## GitHub Pages Configuration
 13  
 14  ### 1. Enable GitHub Pages
 15  
 16  1. Go to your repository settings: `https://github.com/xjmzx/xjmzx.github.io/settings/pages`
 17  2. Under "Build and deployment":
 18     - **Source**: GitHub Actions (should be automatically selected)
 19  3. Under "Custom domain":
 20     - Enter: `ln.fizx.uk`
 21     - Click "Save"
 22  4. Wait for DNS check to complete (may take a few minutes)
 23  5. Enable "Enforce HTTPS" once DNS check passes
 24  
 25  ### 2. DNS Configuration
 26  
 27  Ensure your DNS provider has these records for `ln.fizx.uk`:
 28  
 29  ```
 30  Type: CNAME
 31  Name: ln.fizx.uk (or @ if at root, or subdomain prefix)
 32  Value: xjmzx.github.io
 33  TTL: 3600 (or automatic)
 34  ```
 35  
 36  **Note:** DNS changes can take up to 24-48 hours to propagate globally, but usually take only a few minutes.
 37  
 38  ### 3. Verify DNS Configuration
 39  
 40  Check if DNS is configured correctly:
 41  
 42  ```bash
 43  # Check CNAME record
 44  dig ln.fizx.uk CNAME
 45  
 46  # Should return:
 47  # ln.fizx.uk.   3600   IN   CNAME   xjmzx.github.io.
 48  ```
 49  
 50  Or use online tools:
 51  - https://dnschecker.org
 52  - https://whatsmydns.net
 53  
 54  ## Deployment Process
 55  
 56  ### Automatic Deployment (Recommended)
 57  
 58  Every push to the `main` branch triggers automatic deployment:
 59  
 60  ```bash
 61  # Make your changes
 62  git add .
 63  git commit -m "Your changes"
 64  git push origin main
 65  
 66  # GitHub Actions will automatically:
 67  # 1. Install dependencies
 68  # 2. Build the project
 69  # 3. Deploy to GitHub Pages
 70  # 4. Site will be live at ln.fizx.uk in ~1-2 minutes
 71  ```
 72  
 73  ### Manual Deployment Trigger
 74  
 75  You can manually trigger deployment from GitHub:
 76  
 77  1. Go to: `https://github.com/xjmzx/xjmzx.github.io/actions`
 78  2. Select "Deploy to GitHub Pages" workflow
 79  3. Click "Run workflow" → "Run workflow"
 80  
 81  ### Check Deployment Status
 82  
 83  1. Go to: `https://github.com/xjmzx/xjmzx.github.io/actions`
 84  2. Click on the latest workflow run
 85  3. Monitor the "deploy" job progress
 86  4. Once complete (green checkmark), site is live
 87  
 88  ## Troubleshooting
 89  
 90  ### DNS Not Resolving
 91  
 92  **Problem:** `ln.fizx.uk` doesn't load or shows wrong site
 93  
 94  **Solution:**
 95  1. Verify CNAME record in DNS: `dig ln.fizx.uk CNAME`
 96  2. Check DNS propagation: https://dnschecker.org
 97  3. Clear browser cache / try incognito mode
 98  4. Wait up to 24 hours for DNS propagation
 99  
100  ### 404 Errors on GitHub Pages
101  
102  **Problem:** Site loads but shows 404
103  
104  **Solution:**
105  1. Check `public/CNAME` file exists and contains `ln.fizx.uk`
106  2. Verify custom domain in repository settings matches `ln.fizx.uk`
107  3. Check GitHub Actions completed successfully
108  4. Ensure `dist/404.html` was created during build
109  
110  ### Build Failures
111  
112  **Problem:** GitHub Actions workflow fails
113  
114  **Solution:**
115  1. Check workflow logs: `https://github.com/xjmzx/xjmzx.github.io/actions`
116  2. Look for error messages in the build step
117  3. Common issues:
118     - Missing dependencies: Check `package.json`
119     - TypeScript errors: Run `npm run test` locally
120     - Build errors: Run `npm run build` locally
121  
122  ### HTTPS Not Available
123  
124  **Problem:** Can't enable "Enforce HTTPS"
125  
126  **Solution:**
127  1. Wait for DNS check to complete (can take 24 hours)
128  2. Verify CNAME DNS record is correct
129  3. Check that GitHub detected your custom domain
130  4. Try removing and re-adding custom domain in settings
131  
132  ### Site Shows Old Content
133  
134  **Problem:** Deployed site shows outdated content
135  
136  **Solution:**
137  1. Hard refresh browser: `Ctrl+Shift+R` (Windows) or `Cmd+Shift+R` (Mac)
138  2. Clear browser cache
139  3. Check GitHub Actions completed recently
140  4. Verify `main` branch has latest commits
141  
142  ## Monitoring
143  
144  ### Check Site Status
145  
146  - **Live Site:** https://ln.fizx.uk
147  - **GitHub Actions:** https://github.com/xjmzx/xjmzx.github.io/actions
148  - **Repository Settings:** https://github.com/xjmzx/xjmzx.github.io/settings/pages
149  
150  ### Deployment Times
151  
152  - **Build Time:** ~1-2 minutes
153  - **DNS Propagation:** 5 minutes - 24 hours (usually < 1 hour)
154  - **GitHub Pages Update:** ~30 seconds after build completes
155  - **Total (after first setup):** ~2-3 minutes per deployment
156  
157  ## Best Practices
158  
159  1. **Always test locally before pushing:**
160     ```bash
161     npm run build
162     # Check dist folder
163     ```
164  
165  2. **Use meaningful commit messages:**
166     ```bash
167     git commit -m "Add troubleshooting section to LND guide"
168     ```
169  
170  3. **Monitor deployments:**
171     - Watch GitHub Actions after pushing
172     - Verify changes on live site
173  
174  4. **Branch protection (optional):**
175     - Set up pull requests for major changes
176     - Require review before merging to `main`
177  
178  ## Repository Settings Summary
179  
180  Current configuration:
181  - **Repository:** `xjmzx/xjmzx.github.io`
182  - **Branch:** `main`
183  - **Custom Domain:** `ln.fizx.uk`
184  - **HTTPS:** Enabled (after DNS verification)
185  - **Build:** GitHub Actions
186  - **Workflow:** `.github/workflows/deploy.yml`
187  
188  ## Support
189  
190  If you encounter issues:
191  1. Check GitHub Actions logs
192  2. Verify DNS configuration
193  3. Review this deployment guide
194  4. Check GitHub Pages documentation: https://docs.github.com/pages
195  
196  ---
197  
198  **Last Updated:** 2026-02-01