This guide explains how to deploy the DecisionsDev website to a private preview repository in GitHub Enterprise (GHE) for review purposes before publishing to production.
- Overview
- Prerequisites
- Initial Setup
- Deploying to Preview
- Managing Reviewer Access
- Troubleshooting
- Preview vs Production
The preview deployment workflow allows you to:
- 🔒 Share privately - Only invited reviewers can access the preview site
- ✅ Get feedback - Collect reviews before publishing to production
- 🔄 Iterate quickly - Deploy updates as often as needed
- 🛡️ Protect production - Keep the live site stable while testing changes
Local Changes → Build Site → Deploy to GHE Preview Repo → Share with Reviewers
The preview site is hosted on GitHub Enterprise Pages in a private repository, separate from the public production site.
Before you can deploy to preview, ensure you have:
-
GitHub Enterprise Access
- Access to your organization's GHE instance
- Permissions to create repositories in the DecisionsDev organization
-
Local Development Environment
- Node.js and npm installed
- Git configured with GHE credentials
- This repository cloned locally
-
Dependencies Installed
npm install
- Navigate to your GHE instance
- Go to the DecisionsDev organization
- Click New repository
- Configure the repository:
- Name:
decisionsdev-preview(or your preferred name) - Visibility: Private
⚠️ Important! - Initialize: Leave unchecked (don't add README, .gitignore, or license)
- Name:
- Click Create repository
- In the preview repository, go to Settings → Pages
- Under Source, select:
- Branch:
gh-pages - Folder:
/ (root)
- Branch:
- Click Save
- Note the Pages URL (e.g.,
https://your-ghe.com/pages/DecisionsDev/decisionsdev-preview/)
In your local repository directory, add the preview remote:
git remote add preview https://your-ghe-instance.com/DecisionsDev/decisionsdev-preview.gitReplace your-ghe-instance.com with your actual GHE hostname.
Verify the remote was added:
git remote -vYou should see both origin (production) and preview remotes.
If your GHE instance uses a different hostname, update the URLs in:
tools/deploy-preview.sh(line 60)tools/deploy-preview.bat(line 81)
Replace your-ghe-instance.com with your actual GHE hostname.
On Unix/Mac/Linux:
./tools/deploy-preview.shOn Windows:
tools\deploy-preview.bat- ✅ Validates environment (checks for package.json, preview remote)
- 📦 Installs dependencies (if needed)
- 🧹 Cleans previous builds
- 📚 Fetches and categorizes repositories
- 🔨 Builds the Gatsby site
- 📤 Deploys to the preview repository's
gh-pagesbranch
You can also deploy using npm:
npm run deploy:preview- First deployment: 2-5 minutes
- Subsequent deployments: 1-3 minutes
- Pages build time: 1-2 minutes after deployment
- Go to the preview repository in GHE
- Navigate to Settings → Collaborators and teams
- Click Add people or Add teams
- Search for the reviewer by username or email
- Select Read permission (recommended)
- Click Add [username] to this repository
The reviewer will receive an email invitation.
| Permission | Can View | Can Comment | Can Edit | Recommended For |
|---|---|---|---|---|
| Read | ✅ | ✅ | ❌ | Reviewers |
| Write | ✅ | ✅ | ✅ | Contributors |
| Admin | ✅ | ✅ | ✅ | Maintainers |
Recommendation: Use Read permission for reviewers to prevent accidental changes.
After deployment, share this URL with reviewers:
https://your-ghe-instance.com/pages/DecisionsDev/decisionsdev-preview/
Include in your message:
- Purpose of the review
- Specific areas to focus on
- Deadline for feedback
- How to provide feedback (issues, email, etc.)
- Go to Settings → Collaborators and teams
- Find the user/team
- Click Remove or change their permission level
Problem: The preview remote hasn't been added to your local repository.
Solution:
git remote add preview https://your-ghe-instance.com/DecisionsDev/decisionsdev-preview.gitProblem: You don't have push access to the preview repository.
Solution:
- Verify you're a member of the DecisionsDev organization
- Check your GHE credentials are configured correctly
- Ensure you have at least Write permission on the preview repository
Problem: GitHub Pages hasn't finished building, or Pages isn't enabled.
Solutions:
- Wait 2-3 minutes and refresh
- Check Settings → Pages to ensure it's enabled
- Verify the
gh-pagesbranch exists in the repository - Check the Pages build status in the repository's Actions tab
Problem: Browser cache or Pages build delay.
Solutions:
- Hard refresh:
Ctrl+Shift+R(Windows/Linux) orCmd+Shift+R(Mac) - Clear browser cache
- Wait a few minutes for Pages to rebuild
- Check the deployment timestamp in the repository
Problem: Dependencies or build errors.
Solutions:
- Delete
node_modulesand reinstall:rm -rf node_modules npm install
- Clear Gatsby cache:
npm run clean
- Check for errors in the build output
- Ensure all required files are present
| Aspect | Preview | Production |
|---|---|---|
| Repository | decisionsdev-preview |
DecisionsDev.github.io |
| Visibility | Private | Public |
| URL | your-ghe.com/pages/.../preview |
decisionsdev.github.io |
| Access | Invited collaborators only | Anyone on the internet |
| Remote | preview |
origin |
| Purpose | Review and testing | Live public site |
| Deploy Command | ./tools/deploy-preview.sh |
./tools/deploy.sh |
| Update Frequency | As needed for review | After approval |
graph TD
A[Make Changes Locally] --> B[Test Locally]
B --> C[Deploy to Preview]
C --> D[Share with Reviewers]
D --> E{Approved?}
E -->|No| F[Make Revisions]
F --> B
E -->|Yes| G[Deploy to Production]
G --> H[Live on decisionsdev.github.io]
- Always preview first - Deploy to preview before production
- Get feedback - Share with at least 2-3 reviewers
- Test thoroughly - Check all pages and functionality
- Document changes - Keep track of what's being reviewed
- Clean up - Remove reviewer access after deployment to production
- Main README - Project overview and setup
- Deployment Guide - Production deployment instructions
- Setup Guide - Initial project setup
- GitHub Pages Documentation
If you encounter issues not covered in this guide:
- Check the Troubleshooting section
- Review the build output for error messages
- Consult your GHE administrator for access issues
- Open an issue in the repository
Last updated: 2026-02-23