This guide explains how to deploy the DecisionsDev GitHub Pages site.
- Node.js (v18 or higher)
- npm (comes with Node.js)
- Git configured with GitHub access
chmod +x deploy.sh
./deploy.shdeploy.batnpm install # Install dependencies
npm run clean # Clean previous builds
npm run build # Build the site
npm run deploy # Deploy to GitHub Pages- Checks environment - Verifies you're in the correct directory
- Installs dependencies - Runs
npm installif needed - Cleans previous builds - Removes old build artifacts
- Builds the site - Compiles Gatsby site to
public/directory - Deploys to GitHub Pages - Pushes
public/togh-pagesbranch
- Target:
gh-pagesbranch of the repository - URL: https://decisionsdev.github.io
- Build time: ~2-5 minutes
- Propagation time: 1-5 minutes after deployment
# Clear cache and rebuild
npm run clean
rm -rf node_modules package-lock.json
npm install
npm run buildCheck that you have:
- Write access to the repository
- Git configured correctly
- No uncommitted changes blocking the deployment
- Wait 5-10 minutes for GitHub Pages to propagate
- Clear your browser cache (Ctrl+Shift+R or Cmd+Shift+R)
- Check GitHub repository settings → Pages
npm run dev
# or
npm startVisit http://localhost:8000 to see your changes.
- Test locally with
npm run dev - Verify all changes work as expected
- Commit your changes to git
- Run the deployment script
- Wait a few minutes for propagation
- Visit https://decisionsdev.github.io
- Verify changes are live
- Clear cache if needed
The site is configured to deploy from the gh-pages branch. This is handled automatically by the gh-pages npm package.
Go to: Repository → Settings → Pages
- Source: Deploy from a branch
- Branch:
gh-pages - Folder:
/ (root)
To set up automatic deployment on push:
- Create
.github/workflows/deploy.yml:
name: Deploy to GitHub Pages
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install
- run: npm run build
- run: npm run deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- Push to main branch
- GitHub Actions will automatically deploy
Before deploying, you may want to update the repository list.
Authenticated GitHub API access is recommended because unauthenticated requests can fail with HTTP 403 rate-limit errors.
# PowerShell
$env:GITHUB_TOKEN="your_github_token_here"
npm run build:repos# Bash
export GITHUB_TOKEN="your_github_token_here"
npm run build:reposThis runs tools/build-repositories.js, which fetches the latest repositories from the DecisionsDev organization and rebuilds src/data/repositories.json.
For issues:
- Check the Gatsby documentation
- Check the gh-pages documentation
- Open an issue in the repository
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build production site |
npm run serve |
Serve production build locally |
npm run clean |
Clean build cache |
npm run deploy |
Deploy to GitHub Pages |
./deploy.sh |
Full deployment (Linux/Mac) |
deploy.bat |
Full deployment (Windows) |