deploy
Build TypeScript, run tests, and push to Google Apps Script. Use for deployment, pushing changes, or when the user says deploy, push, or release.
When & Why to Use This Skill
This Claude skill automates the end-to-end deployment pipeline for Google Apps Script (GAS) projects. It streamlines the development workflow by integrating TypeScript compilation, automated testing, and secure code pushing via the clasp CLI. By enforcing quality checks before deployment, it ensures that only stable, error-free code reaches the production environment, significantly reducing manual overhead and deployment risks for Google Workspace developers.
Use Cases
- Automated Deployment: Seamlessly push TypeScript updates to Google Sheets, Docs, or Forms add-ons using a standardized build-and-push workflow.
- Quality Assurance: Automatically run unit tests and TypeScript type-checking before every release to prevent broken code from affecting end-users.
- Environment Synchronization: Efficiently sync local development changes with the Google Apps Script online editor while maintaining a clean, bundled codebase.
- Rapid Iteration: Accelerate the development cycle of Google Workspace scripts by automating repetitive build and deployment tasks, allowing developers to focus on core logic.
- Error Prevention: Utilize pre-deployment checklists and troubleshooting procedures to handle authentication issues or build errors before they impact production.
| name | deploy |
|---|---|
| description | Build TypeScript, run tests, and push to Google Apps Script. Use for deployment, pushing changes, or when the user says deploy, push, or release. |
| allowed-tools | Bash, Read, Grep |
Deploy to Google Apps Script
Performs the complete build-test-push workflow for deploying to Google Apps Script.
Pre-Deployment Checklist
Before deploying:
- Ensure you are on the correct branch
- All changes are committed
- Quality checks pass
Workflow
Step 1: Run Quality Checks
npm test && npx tsc --noEmit
STOP if any tests fail. Do not proceed with deployment.
Step 2: Build Bundle
npm run build
Verify:
dist/bundle.jsis generated- No build errors
- File size is reasonable (< 1MB)
Step 3: Push to GAS
clasp push
Watch for:
- Authentication errors (run
clasp loginif needed) - File upload confirmation
- No manifest errors
Step 4: Verify Deployment
clasp open
In Apps Script editor:
- Verify
bundle.jsis updated - Check manifest (
appsscript.json) is correct
Quick Deploy Command
npm run build && npm test && clasp push
Full Deploy with Version
npm run deploy
Results Summary
Report:
- Tests: PASS/FAIL
- Build: PASS/FAIL
- Push: SUCCESS/FAILED
Troubleshooting
| Error | Solution |
|---|---|
| Auth error | Run clasp login to refresh credentials |
| Build error | Fix TypeScript errors in src/ |
| Test failure | Fix failing tests before push |
| Push timeout | Check network, retry with clasp push |
Rollback Procedure
If deployment causes issues:
- Revert to previous commit locally
- Rebuild:
npm run build - Re-push:
clasp push