GitHub Pages Setup Guide
This document explains how to set up GitHub Pages for FinFocus documentation.
Overview
Section titled “Overview”FinFocus documentation is deployed to GitHub Pages from the docs/ directory using
Astro Starlight with a Node.js-based build pipeline. This guide shows how to configure
the repository for automatic deployment.
Prerequisites
Section titled “Prerequisites”- GitHub repository admin access
- Main branch with
docs/directory .github/workflows/docs-build-deploy.ymlworkflow file (included)
Setup Steps
Section titled “Setup Steps”1. Enable GitHub Pages
Section titled “1. Enable GitHub Pages”Go to your repository settings:
- Navigate to Settings → Pages
- Under “Build and deployment”:
- Source: Select “GitHub Actions”
- This enables GitHub Actions to deploy to Pages
2. Verify Workflow Permissions
Section titled “2. Verify Workflow Permissions”Ensure the workflow has permission to deploy:
- Go to Settings → Actions → General
- Under “Workflow permissions”:
- Select “Read and write permissions”
- Enable “Allow GitHub Actions to create and approve pull requests”
- Click Save
3. Configure Custom Domain (Optional)
Section titled “3. Configure Custom Domain (Optional)”If using a custom domain:
-
Create a
docs/CNAMEfile with your domain:docs.finfocus.com -
Configure domain in Settings → Pages:
- Enter your custom domain
- GitHub will add DNS records instructions
-
Update DNS records at your domain provider
4. Verify Deployment
Section titled “4. Verify Deployment”After push to main:
- Go to Actions tab
- Look for “Build & Deploy Documentation” workflow
- Verify workflow completes successfully
- Visit GitHub Pages URL:
- Default:
https://rshade.github.io/finfocus/ - Custom domain:
https://docs.finfocus.com/
- Default:
Troubleshooting
Section titled “Troubleshooting”Workflow Fails to Deploy
Section titled “Workflow Fails to Deploy”Check workflow permissions:
gh api repos/rshade/finfocus/actions/permissionsBuild Fails
Section titled “Build Fails”Check the workflow logs:
- Go to Actions tab
- Click on failed workflow
- Expand “Build Documentation” job
- Look for error messages
Common issues:
- Missing dependencies: Run
cd docs && npm ci - Astro build errors: Check
astro.config.mjssyntax andpackage.jsonscripts - Link errors: Run
make docs-lintlocally
Pages Not Updating
Section titled “Pages Not Updating”- Verify workflow is enabled (check
.github/workflows/docs-build-deploy.ymlexists) - Check that changes are pushed to
mainbranch - Verify
docs/directory changes triggered the workflow - Check workflow logs for failures
Manual Deployment (if needed)
Section titled “Manual Deployment (if needed)”If automatic deployment fails, you can deploy manually:
# Build locallycd docsnpm cinpm run build
# Upload to GitHub Pages (requires authentication)# Note: This is rarely needed - use workflows insteadMaintenance
Section titled “Maintenance”Monitor Deployments
Section titled “Monitor Deployments”View all deployments:
gh deployment list --repo rshade/finfocusView Site Analytics
Section titled “View Site Analytics”- Go to Settings → Pages
- View deployment history and status
Update Workflow
Section titled “Update Workflow”If you modify the workflow:
# Validate workflow syntaxgh workflow validate .github/workflows/docs-build-deploy.yml
# Push changesgit add .github/workflows/docs-build-deploy.ymlgit commit -m "docs: Update GitHub Pages workflow"git push origin mainConfiguration Files
Section titled “Configuration Files”Key Files
Section titled “Key Files”- docs/package.json - Node.js dependencies
- docs/astro.config.mjs - Astro/Starlight configuration
- docs/tsconfig.json - TypeScript configuration
- docs/.markdownlint-cli2.jsonc - Markdown linting
- .github/workflows/docs-build-deploy.yml - Deployment workflow
Modify Configuration
Section titled “Modify Configuration”To change site configuration:
- Edit
docs/astro.config.mjsordocs/package.json - Test locally:
make docs-serve - Push to main (triggers rebuild)
Reference
Section titled “Reference”Last Updated: 2025-10-29