Agent skill
deployment-workflow
Deployment workflow for gh-pr-linear-issue-linker. Use when deploying to GCP, verifying deployments, or running tests.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/deployment-workflow
SKILL.md
Deployment Workflow
Deployment Strategy
This service uses:
- Terraform for infrastructure (Cloud Run, Artifact Registry, Secret Manager)
- Google Cloud Build for container builds (triggered automatically by Terraform)
- Cloud Run for serverless container hosting
Deployment Commands
Check code quality before deployment:
make check
This runs: ruff format + ruff check + pytest
Deploy to GCP:
make deploy
# or
make tf-apply
This will:
- Initialize Terraform
- Create/update infrastructure
- Trigger Cloud Build to build and push Docker image (only if Dockerfile changed)
- Deploy new image to Cloud Run
- Configure public access for GitHub webhooks
Terraform Operations
Initialize Terraform:
make tf-init
# or
cd infra && terraform init
Plan changes:
make tf-plan
# or
cd infra && terraform plan
Apply changes:
make tf-apply
# or
cd infra && terraform apply
View outputs:
make tf-output
# or
cd infra && terraform output
Pre-Deployment Checklist
Always run before deployment:
- Check code quality:
make check
- Review Terraform plan:
make tf-plan
- Ensure secrets are configured in
infra/terraform.tfvars
Test Execution
Run all quality checks:
make check
Run tests only:
make test
# or
pytest
Run specific test file:
pytest tests/test_webhook.py
Run with coverage:
pytest --cov=src --cov-report=term-missing
Deployment Verification
After deployment, verify:
- Check Cloud Run service status:
gcloud run services describe gh-pr-linear-issue-linker \
--region=us-central1 \
--format=yaml
- Check recent logs:
gcloud logging tail "resource.type=cloud_run_revision" \
--limit=50
- Test webhook endpoint:
curl https://YOUR-SERVICE-URL/health
- Check Logfire for traces
Results Reporting Format
## Deployment Summary
**Service**: gh-pr-linear-issue-linker
**Platform**: Google Cloud Run
**Status**: Success | Failed
### Build Result
- Format: Pass/Fail (ruff)
- Lint: Pass/Fail (ruff)
- Tests: X passed, Y failed (pytest)
### Deployment Result
- Terraform: Applied successfully
- Cloud Build: Build ID {build-id}
- Cloud Run: Deployed revision {revision-name}
- URL: {service-url}
### Next Steps
- Monitor Cloud Logging for errors
- Check Logfire for webhook traces
- Verify GitHub webhook deliveries
Failure Handling
Build Failures
make check
Check output for:
- Formatting issues:
ruff format . - Linting errors:
ruff check . --fix - Test failures:
pytest -v
Terraform Failures
make tf-plan
Review plan output for issues:
- Resource conflicts
- Missing variables in
terraform.tfvars - State drift
- Permission issues
Cloud Build Failures
Check build logs:
gcloud builds list --limit=5
gcloud builds log {build-id}
Common issues:
- Dockerfile syntax errors
- Missing dependencies in requirements.txt
- Build timeout (increase in
cloudbuild.yaml)
Runtime Failures
Check Cloud Run logs:
gcloud logging read "resource.type=cloud_run_revision AND severity>=ERROR" \
--limit=50
Use Logfire for detailed trace analysis.
Critical Constraints
- Secrets management: Never commit secrets - use
infra/terraform.tfvars(gitignored) - Always run
make checkbefore deployment - Use make commands for consistency
- Monitor Logfire after deployment for errors
Available Commands
Run make help to see all available commands. Key commands:
make check- Format + lint + tests (run before commits)make test- Run tests onlymake deployormake tf-apply- Deploy to GCPmake tf-plan- Preview infrastructure changesmake tf-output- View Terraform outputs
Environment Variables
Secrets are managed via Secret Manager and injected into Cloud Run:
| Variable | Purpose | Source |
|---|---|---|
GITHUB_APP_ID |
GitHub App authentication | Secret Manager |
GITHUB_PRIVATE_KEY |
GitHub App private key | Secret Manager |
LINEAR_API_KEY |
Linear API access | Secret Manager |
WEBHOOK_SECRET |
GitHub webhook signature | Secret Manager |
LOGFIRE_TOKEN |
Logfire observability | Secret Manager |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?