Deploying Updates
Deployments happen automatically when you push to the master branch on GitHub. A webhook listener on the server detects the push and runs the full deployment pipeline — no SSH required.
Automatic Deployment (Recommended)
Simply push your changes to master:
git add .
git commit -m "Update documentation"
git push origin master
That's it. Within a few minutes, the site will be rebuilt and live at https://docs.rhinogroup.com.
How It Works
GitHub Push → Webhook POST → docs.rhinogroup.com/webhook
→ Node.js listener validates HMAC signature
→ Filters for master branch pushes only
→ Spawns update-docs.sh (all 7 steps)
Monitoring Auto-Deploy
Check the webhook log on the server:
ssh docsrhinogroup@vps3
tail -f ~/webhook.log
The log shows accepted/rejected requests, deploy start/finish, and exit codes.
Manual Deployment (Fallback)
If the webhook is down or you need to trigger a deploy manually:
Prerequisites:
- SSH access to vps3 as
docsrhinogroupuser
# 1. SSH into the server
ssh docsrhinogroup@vps3
# 2. Run the deployment script
update-docs.sh
Full Pinecone Reindex
To force a complete vector reindex (all ~200 pages, takes 20-30 minutes):
update-docs.sh --reindex-all
Deployment Steps
The update-docs.sh script performs these steps automatically:
| Step | Action | Purpose |
|---|---|---|
| 1 | git stash | Save any uncommitted local changes |
| 2 | git pull | Fetch latest changes from GitHub master branch |
| 3 | npm run build | Build the Docusaurus static site |
| 4 | cp -R build/* /home/docsrhinogroup/public_html/ | Deploy built files to web root |
| 5 | Typesense scraper | Re-index search with updated content |
| 6 | Pinecone indexing | Update vector embeddings (optional, if API key set) |
| 7 | Cloudflare cache purge | Clear CDN cache (optional, if credentials set) |
Logging: All deployment activity is logged to ~/update-docs.log
What Happens During Each Step
Step 1-2: Git Operations
- Stashes any local changes (preserves server-side edits if needed)
- Pulls the latest documentation from the
masterbranch - Important: Changes must be committed and pushed to GitHub first
Step 3: Build
- Compiles all markdown and React pages into static HTML/CSS/JS in
build/ - Runs the
docsearch-meta-pluginpostBuild hook, which injectsclient_tagandsite_tagmeta tags - Reports any broken links as warnings
- Auto-retries with
npm installif build fails
Step 4: Deploy
- Clears the web root (preserving
.htaccessand.htpasswd) - Copies all built files to
/home/docsrhinogroup/public_html/
Step 5: Typesense Search Indexing
- Starts the DocSearch scraper Docker container
- Scrapes the built site's HTML and indexes into the
rhino-docscollection - Picks up
docsearch:client_taganddocsearch:site_tagmeta attributes as faceted fields - Skipped if: Docker is not available
Step 6: Pinecone Vector Indexing
- Detects changed documentation pages using git diff
- Generates vector embeddings for new/modified pages
- Updates the Pinecone vector database for semantic search
- Skipped if:
PINECONE_API_KEYnot set in.envfile
Step 7: Cloudflare Cache Purge
- Purges all cached content from Cloudflare CDN
- Ensures users see the latest documentation immediately
- Skipped if:
CLOUDFLARE_ZONE_IDorCLOUDFLARE_API_TOKENnot set in.envfile
Environment Configuration
Optional features require environment variables in /home/docsrhinogroup/docs/.env:
# Pinecone vector database (optional)
PINECONE_API_KEY=your_api_key_here
# Cloudflare cache purging (optional)
CLOUDFLARE_ZONE_ID=aaed4ff0f779214003efc38da6f6576a
CLOUDFLARE_API_TOKEN=your_token_here
See .env.example for the template.
Verifying a Deployment
After deployment:
- Open https://docs.rhinogroup.com and verify the homepage loads
- Navigate to any recently changed page to confirm updates are live
- Test search — try filtering by client and site
- Check that new clients/sites appear in the search dropdown filters
- Review
~/update-docs.logfor any warnings or errors
Troubleshooting
Build Fails
- Check
~/update-docs.logfor the error message - The script automatically runs
npm installand retries once - Verify the commit builds successfully locally:
npm run build
Search Not Updated
- Check if Docker is running:
docker ps - Verify Typesense container is up:
docker ps | grep typesense - Review scraper logs in the deployment output
Cloudflare Cache Not Cleared
- Verify
.envfile has bothCLOUDFLARE_ZONE_IDandCLOUDFLARE_API_TOKEN - Check the Cloudflare API token has
Zone.Cache Purgepermission - Review the purge API response in the deployment log
Manual Deployment (Legacy)
If both the webhook and update-docs.sh are unavailable, you can deploy step-by-step:
cd /home/docsrhinogroup/docs
git pull
npm install
npm run build
cp -R build/* /home/docsrhinogroup/public_html/
./typesense/scrape.sh
Note: This skips Pinecone indexing and Cloudflare cache purging.
Webhook Troubleshooting
Webhook Not Triggering
- Check the service is running:
sudo systemctl status docs-webhook - Verify GitHub delivery succeeded: GitHub → Repository → Settings → Webhooks → Recent Deliveries
- Check the webhook log for errors:
tail -20 ~/webhook.log
Restarting the Webhook Service
sudo systemctl restart docs-webhook
sudo systemctl status docs-webhook
Deploy Stuck (Lockfile)
If a deploy crashes mid-run, the lockfile may prevent new deploys:
rm /tmp/docs-deploy.lock
Rollback
If a deployment causes issues:
cd /home/docsrhinogroup/docs
git log --oneline -5 # Find the previous good commit
git checkout <commit-hash>
update-docs.sh # Re-deploy the previous version
Or revert the commit on GitHub and run update-docs.sh again.