This document describes the CI/CD pipelines that automate development, testing, and deployment for KanaDojo.
- Overview
- Pull Request Workflows
- Issue Management Workflows
- Community Contribution Workflows
- Deployment Workflows
- Other Workflows
KanaDojo uses GitHub Actions for automation across the development lifecycle. Workflows are defined in .github/workflows/ and cover:
- Code Quality: Running linters, type checks, and tests
- Pull Requests: Automated checks and contributor onboarding
- Issue Management: Auto-responses and stale issue handling
- Community: Managing theme/fact/proverb contributions
- Deployment: Vercel integration and Discord notifications
Trigger: On pull_request (opened, synchronize)
Purpose: Ensures all PRs pass code quality checks before review
Steps:
- Checkout code
- Setup Node.js 20 with npm caching
- Install dependencies (
npm ciornpm install) - Run
npm run check(TypeScript + ESLint) - Comment on PR with results
- Fail if checks don't pass
Outputs:
- Success/failure comment on PR
- Prevents merging if checks fail
Trigger: On pull_request_target (opened)
Purpose: Greets new contributors with onboarding information
Steps:
- Checkout repository
- Post welcome message with checklist
- Detect first-time contributors and add special message
Features:
- Personalized greeting based on PR author
- Checklist of PR requirements
- Special message for first-time contributors
Trigger: On pull_request_target (closed, merged)
Purpose: Automatically closes linked community issues when PRs merge
Steps:
- Checkout repository
- Parse PR title and body for contribution type (theme, fact, proverb)
- Find linked issue (explicit
Closes #or pattern matching) - Comment on issue with merge notification
- Close issue as completed
- Update backlog files (
data/community/*.json)
Contribution Types:
- Themes: Looks for
Add New Color Theme:pattern - Facts: Looks for
Add Japan Fact #pattern - Proverbs: Looks for
Add Japanese Proverb #pattern
Trigger: On issue_comment (created)
Purpose: Automatically assigns and responds to community-labeled issues
Logic:
- Only runs on issues with
communitylabel - If issue already assigned: alerts commenter
- If unassigned: assigns to commenter and provides next steps
Response Includes:
- Greeting and assignment confirmation
- Next steps for the contributor
- Resources (docs, Discord link)
- Encouragement message
Trigger: Scheduled (hourly), or manual workflow_dispatch
Purpose: Prevents community issues from going stale
Logic:
- Fetch all open issues with
communitylabel - Check time since last activity
- If > 12 hours without activity: add warning label and comment
- If > 24 hours without activity: close issue and unassign contributor
- Re-enable backlog items if their issues are closed
Backlog Files:
data/community/theme-backlog.jsondata/community/facts-backlog.jsondata/community/proverbs-backlog.json
Trigger: Scheduled (hourly)
Purpose: Periodically checks and updates community issue status
Features:
- Syncs issue status with backlog files
- Can re-enable items that were closed without completion
Trigger: On pull_request
Purpose: Specialized review workflow for community contributions
Features:
- Lighter-weight checks for community PRs
- Focuses on content (themes, facts, proverbs) rather than code
Trigger: On deployment_status event
Purpose: Sends Discord notifications for Vercel deployments
Jobs:
notify-discord: On failure/error, sends detailed error reportnotify-success: On production success, announces deployment
Features:
- Rich embed messages with deployment details
- Links to commit, deployment, and workflow run
- Color-coded (red for failures, green for success)
Environment Variables Required:
DISCORD_WEBHOOK_URL: Discord webhook for notifications
Trigger: On push to main branch
Purpose: Keeps preview branch in sync with main
Steps:
- Checkout repository with full history
- Create/update
previewbranch from main - Force push to preview branch
Trigger: On push to main when features/PatchNotes/patchNotesData.json changes
Purpose: Posts patch notes to Discord on new releases
Features:
- Parses
patchNotesData.json - Categorizes changes (features, improvements, fixes)
- Sends formatted embed to Discord
Most workflows use concurrency groups to prevent race conditions:
concurrency:
group: workflow-name-${{ github.event.*.id }}
cancel-in-progress: trueAll workflows follow least-privilege principles:
contents: readfor checkoutissues: writefor issue managementpull-requests: writefor PR commentscontents: writeonly when committing changes
- Check branch protection rules
- Verify workflow trigger conditions
- Check repository permissions
- Ensure workflow has correct
permissionsblock - For commits, use
secrets.GITHUB_TOKEN
GitHub Actions has limits on:
- Job execution time (35 min/job)
- API calls per hour
- Concurrent jobs
- Create
.github/workflows/workflow-name.yml - Define trigger conditions
- Set permissions
- Add jobs and steps
- Test with
workflow_dispatchtrigger