Configure CI/CD pipelines for Documenso integrations.
Use when setting up automated testing, deployment pipelines,
or continuous integration for Documenso projects.
Trigger with phrases like "documenso CI", "documenso GitHub Actions",
"documenso pipeline", "documenso automated testing".
Configure CI/CD pipelines for Documenso integrations.
Use when setting up automated testing, deployment pipelines,
or continuous integration for Documenso projects.
Trigger with phrases like "documenso CI", "documenso GitHub Actions",
"documenso pipeline", "documenso automated testing".
Configure CI/CD pipelines for Documenso integrations with GitHub Actions. Covers unit testing with mocks, integration testing against staging, and deployment workflows with secret management.
Prerequisites
GitHub repository with Actions enabled
Documenso staging API key
Test environment configured (see documenso-local-dev-loop)
Instructions
Step 1: GitHub Actions Workflow
# .github/workflows/documenso-ci.ymlname:DocumensoCIon:push:branches: [main, develop]
pull_request:branches: [main]
env:NODE_ENV:testjobs:unit-tests:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v4-uses:actions/setup-node@v4with:node-version:'20'cache:'npm'-run:npmci-run:npmtest# Unit tests use mocks — no API key neededintegration-tests:runs-on:ubuntu-latestif:
# Using GitHub CLI
gh secret set DOCUMENSO_STAGING_API_KEY --body "api_stg_xxxxxxxxxxxx"
gh secret set DOCUMENSO_WEBHOOK_SECRET --body "whsec_xxxxxxxxxxxx"# Verify secrets exist
gh secret list
Step 5: Package.json Scripts
{"scripts":{"test":"vitest run tests/unit/","test:integration":"vitest run tests/integration/ --timeout 60000","test:cleanup":"tsx scripts/cleanup-test-docs.ts","test:all":"npm test && npm run test:integration"}}
Step 6: Pre-commit Hook (Optional)
# .husky/pre-commit
npm test -- --run
This runs unit tests (with mocks) before every commit, catching issues early without needing API access.