CloudCore Netlify Deployment Guide
π Complete Setup for Netlify + GitHub Actions
This guide shows how to deploy the CloudCore site with the enhanced UC admin interface to Netlify, with automatic builds from GitHub.
π Prerequisites
- GitHub repository with CloudCore code
- Netlify account (free tier works)
- GitHub personal access token
- Basic understanding of environment variables
π§ Step 1: Set Up Netlify Site
1.1 Create New Site
- Go to Netlify Dashboard
- Click βNew site from Gitβ
- Choose GitHub and authorize Netlify
- Select your CloudCore repository
- Important: Leave build settings empty (weβll use GitHub Actions)
- Click βDeploy siteβ
1.2 Get Netlify Credentials
- In your site dashboard, go to Site settings
- Note your Site ID (under Site details)
- Go to User settings β Applications β Personal access tokens
- Generate a new token with full access
- Copy the token (youβll need both Site ID and token)
π Step 2: Configure GitHub Secrets
Go to your GitHub repository β Settings β Secrets and variables β Actions
Add these Repository secrets:
Secret Name | Value | Description |
---|---|---|
NETLIFY_AUTH_TOKEN |
Your Netlify personal access token | For GitHub Actions to deploy |
NETLIFY_SITE_ID |
Your Netlify site ID | Target site for deployment |
GITHUB_TOKEN |
Personal access token with repo access | For Netlify Functions to access repo |
UC_TOKENS |
JSON string of UC tokens (see below) | Unit coordinator authentication |
ADMIN_TOKEN |
Random secure string | Master admin access |
UC_TOKENS Format
{
"ISYS6018": {
"token": "secure_random_string_1",
"name": "Dr. Smith"
},
"ISYS2002": {
"token": "secure_random_string_2",
"name": "Prof. Johnson"
},
"ISYS6014": {
"token": "secure_random_string_3",
"name": "Dr. Williams"
},
"ISAD5001": {
"token": "secure_random_string_4",
"name": "Prof. Brown"
}
}
βοΈ Step 3: Configure Netlify Environment Variables
In Netlify Dashboard β Site settings β Environment variables:
Variable | Value | Description |
---|---|---|
GITHUB_TOKEN |
Same as GitHub secret | For API access |
GITHUB_OWNER |
Your GitHub username | Repository owner |
GITHUB_REPO |
Repository name | Usually βcloudcoreβ |
UC_TOKENS |
Same JSON as GitHub secret | UC authentication |
ADMIN_TOKEN |
Same as GitHub secret | Admin access |
π Step 4: Verify File Structure
Ensure your repository has these files:
cloudcore/
βββ .github/workflows/netlify-deploy.yml
βββ netlify.toml
βββ config/
β βββ unit-access.json
β βββ unit-access-schema.json
βββ netlify/functions/
β βββ auth.js
β βββ github-api.js
β βββ package.json
βββ admin/
β βββ index.html
β βββ login.html
β βββ dashboard.html
β βββ dashboard.js
βββ [existing Quarto files]
π Step 5: Deploy
5.1 Trigger First Deployment
- Push any change to main branch
- Check Actions tab in GitHub - should see workflow running
- Monitor build progress (typically 3-5 minutes)
- Check Netlify dashboard for deployment status
5.2 Test Deployment
- Visit your Netlify site URL
- Verify main site loads correctly
- Go to
/admin/
- should see admin portal - Test login with UC tokens
π Step 6: Set Up UC Access
6.1 Generate Secure Tokens
# Generate random tokens (run locally)
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
6.3 Test UC Access
- Each UC logs in with their token
- Verify they see only their unit
- Test content editing
- Test access control configuration
π Troubleshooting
Build Fails in GitHub Actions
Problem: R dependencies error
# Add to workflow if you use R code
- name: Setup R
uses: r-lib/actions/setup-r@v2
Problem: Quarto not found
# Ensure Quarto setup step exists
- uses: quarto-dev/quarto-actions/setup@v2
Netlify Functions Not Working
Problem: Function cold starts - Add warming mechanism or upgrade to Pro plan
Problem: Environment variables not accessible - Verify variables set in Netlify dashboard - Check case sensitivity
Authentication Issues
Problem: βInvalid tokenβ errors - Verify UC_TOKENS
is valid JSON - Check token format in environment variables - Ensure GitHub token has repo permissions
Problem: Session expires quickly - Adjust session timeout in dashboard.js
- Check browser localStorage
GitHub API Errors
Problem: Rate limiting - Implement request caching - Use more specific API calls
Problem: Permission denied - Verify GitHub token permissions - Check repository access
π Ongoing Maintenance
Weekly Tasks
- Monitor deployment status
- Check function logs in Netlify
- Verify UC access still working
Semester Tasks
- Update UC tokens and credentials
- Review and update access configurations
- Test with new unit requirements
As Needed
- Update GitHub token (expires annually)
- Scale up Netlify plan if needed
- Monitor usage and costs
π Monitoring
GitHub Actions
- Check workflow status regularly
- Monitor build times
- Set up notifications for failures
Netlify Analytics
- Track admin interface usage
- Monitor function execution times
- Watch for errors in function logs
Security
- Rotate tokens annually
- Monitor login attempts
- Review access logs
π Emergency Procedures
If Site Goes Down
- Check GitHub Actions status
- Verify Netlify deployment status
- Check environment variables still set
- Test with backup deployment method
If UC Canβt Access
- Verify their token in
UC_TOKENS
- Check Netlify function logs
- Test admin token access
- Provide temporary workaround
If Data Lost
- Check GitHub commit history
- Use git to rollback if needed
- Restore from configuration backups
- Re-deploy from known good commit
π Scaling Considerations
Performance Optimization
- Enable Netlify CDN
- Optimize function cold starts
- Implement request caching
Security Enhancements
- Add IP restrictions
- Implement proper rate limiting
- Set up monitoring alerts
Feature Additions
- Add user management interface
- Implement audit logging
- Create backup/restore functionality
β Quick Verification Checklist
After deployment, verify:
π― Success Criteria
Your deployment is successful when:
- UCs can log in with their tokens
- Content management works (CRUD operations)
- Access control saves to GitHub
- Site rebuilds automatically on changes
- All changes are version-controlled
Need help? Check Netlify function logs and GitHub Actions logs for detailed error information.