This directory contains automated deployment workflows for the NBD Grading System.
- Trigger: Push to
mainbranch whenapps-script/changes - Manual: Can be triggered via GitHub Actions UI
- What it does:
- Updates configuration with secrets
- Pushes code to Apps Script
- Creates new version
- Deploys to production
- Trigger: Push to
mainbranch whencloud-function/changes - Manual: Can be triggered via GitHub Actions UI
- What it does:
- Authenticates with GCP
- Deploys Cloud Function
- Outputs function URL
- Trigger: Pull requests and pushes to
main - What it does:
- Lints Python code
- Validates Apps Script files
- Validates notebook formats
See SECRETS.md for complete instructions on configuring GitHub secrets.
-
Configure secrets (Settings → Secrets → Actions):
CLASP_CREDENTIALS APPS_SCRIPT_ID TEACHER_EMAIL SHEET_ID GCP_PROJECT_ID GCP_REGION GCP_SERVICE_ACCOUNT_KEY CLOUD_FUNCTION_URL (optional) -
Enable workflows:
- Go to Actions tab
- Enable workflows if prompted
-
Test deployment:
# Make a small change to trigger workflow echo "# Updated" >> apps-script/README.md git add apps-script/README.md git commit -m "Test: trigger Apps Script deployment" git push
-
Monitor deployment:
- Go to Actions tab
- Watch workflow execution
- Check logs for any errors
You can also manually trigger deployments:
- Go to Actions tab
- Select workflow (Deploy Apps Script or Deploy Cloud Function)
- Click Run workflow
- Select branch and click Run workflow
Add these to your README.md:


- Check that secrets are configured correctly
- Verify
CLASP_CREDENTIALSis valid JSON - Ensure
GCP_SERVICE_ACCOUNT_KEYhas required permissions
- Apps Script may need manual redeployment for web app
- Go to Apps Script editor → Deploy → Manage deployments
- Edit deployment and save
- Check that
CLOUD_FUNCTION_URLsecret is updated - Re-deploy Apps Script to pick up new URL
- Verify Cloud Function allows unauthenticated calls
Recommended workflow for development:
-
Create feature branch:
git checkout -b feature/my-feature
-
Make changes and test locally:
# Test Apps Script cd apps-script && clasp push && clasp deploy # Test Cloud Function cd cloud-function && gcloud functions deploy ...
-
Create pull request:
git push -u origin feature/my-feature
- CI tests run automatically
- Review deployment preview
-
Merge to main:
- Deployments run automatically
- Monitor in Actions tab
GitHub Actions usage:
- Free tier: 2,000 minutes/month for public repos
- Typical deployment: ~2-3 minutes
- ~60 deployments per month before hitting limits
To optimize:
- Use
pathsfilters to only run on relevant changes - Combine related changes in single commit
- Use manual triggers for testing
- Secrets are encrypted at rest
- Secrets are not exposed in logs
- Service accounts use least-privilege access
- Credentials are rotated every 90 days