Deployment Guide
Overview
Section titled “Overview”This guide covers deployment, installation, configuration, and operational aspects of the Warcraft II Notifications Plugin for OpenCode.
Table of Contents
Section titled “Table of Contents”- Installation
- Configuration
- Platform-Specific Setup
- Deployment Architecture
- CI/CD Pipeline
- Monitoring
- Troubleshooting
- Maintenance
- Security
Configuration
Section titled “Configuration”Configuration Hierarchy
Section titled “Configuration Hierarchy”Project-Specific Configuration
Section titled “Project-Specific Configuration”Location: <project>/.opencode/plugin.json
{ "@pantheon-ai/opencode-warcraft-notifications": { "soundsDir": "/path/to/project/sounds", "faction": "alliance" }}Use Case: Different sound preferences per project
Global Configuration
Section titled “Global Configuration”Location: ~/.config/opencode/plugin.json
{ "@pantheon-ai/opencode-warcraft-notifications": { "soundsDir": "/home/user/.cache/warcraft-sounds", "faction": "horde" }}Use Case: User-wide default preferences
Environment Variables
Section titled “Environment Variables”# Override data directoryexport SOUNDS_DATA_DIR=/custom/sounds/path
# Enable debug loggingexport DEBUG_OPENCODE=1
# Override base URL (legacy)export SOUNDS_BASE_URL=https://custom-cdn.com/soundsConfiguration Options
Section titled “Configuration Options”soundsDir
Section titled “soundsDir”Type: string (optional)
Description: Custom directory for sound file storage
Default: Platform-specific (see Platform-Specific Setup)
Example:
{ "soundsDir": "/custom/sounds/path"}faction
Section titled “faction”Type: 'alliance' | 'horde' | 'both' (optional)
Description: Which faction sounds to play
Default: 'both'
Options:
'alliance': Play only Alliance unit sounds'horde': Play only Horde unit sounds'both': Play random sounds from both factions
Example:
{ "faction": "horde"}Platform-Specific Setup
Section titled “Platform-Specific Setup”Default Locations
Section titled “Default Locations”# Configuration~/.config/opencode/plugin.json
# Sound storage~/Library/Application Support/opencode/storage/plugin/@pantheon-ai/opencode-warcraft-notifications/sounds/Required Commands
Section titled “Required Commands”# Audio playback (built-in)afplay
# Notifications (built-in)osascriptVerification
Section titled “Verification”# Test audio playbackafplay /System/Library/Sounds/Glass.aiffNote: The plugin uses OpenCode’s built-in toast notification system, so no additional notification setup is required.
Default Locations
Section titled “Default Locations”# Configuration~/.config/opencode/plugin.json
# Sound storage (XDG compliant)~/.local/share/opencode/storage/plugin/@pantheon-ai/opencode-warcraft-notifications/sounds/Required Commands
Section titled “Required Commands”# Audio playbacksudo apt-get install libcanberra-gtk-module # Ubuntu/Debiansudo dnf install libcanberra-gtk3 # Fedorasudo pacman -S libcanberra # ArchVerification
Section titled “Verification”# Test audio playbackcanberra-gtk-play --id=messageNote: The plugin uses OpenCode’s built-in toast notification system, so no additional notification setup is required.
Windows
Section titled “Windows”Default Locations
Section titled “Default Locations”# Configuration%APPDATA%\opencode\plugin.json
# Sound storage%APPDATA%\opencode\storage\plugin\opencode-warcraft-notifications\Status
Section titled “Status”Note: Windows support is planned for a future release. Currently supported: macOS and Linux.
Deployment Architecture
Section titled “Deployment Architecture”Package Distribution
Section titled “Package Distribution”Package Structure
Section titled “Package Structure”@pantheon-ai/opencode-warcraft-notifications/├── index.ts # Entry point├── src/ # Source code│ ├── notification.ts│ ├── plugin-config.ts│ ├── sounds.ts│ ├── bundled-sounds.ts│ └── sound-data/├── data/ # Bundled sounds (50+ MB)│ ├── alliance/│ └── horde/├── docs/ # Documentation│ └── schemas/├── package.json└── README.mdInstallation Flow
Section titled “Installation Flow”CI/CD Pipeline
Section titled “CI/CD Pipeline”Workflow Overview
Section titled “Workflow Overview”Workflows
Section titled “Workflows”1. Version Update
Section titled “1. Version Update”Trigger: Push to main branch (code changes only)
Purpose: Automatically determine semantic version bump using conventional commits
Steps:
- Analyze commits since last tag
- Use conventional commit patterns to determine version type
- Create version bump PR with updated
package.json - Auto-merge PR (workflow 3)
- Create git tag (workflow 4)
- Tag triggers release (workflow 5)
Version Types:
- MAJOR: Breaking changes (
BREAKING CHANGE,!:) - MINOR: New features (
feat:) - PATCH: Bug fixes, improvements (
fix:,chore:,docs:)
2. Release & Publish
Section titled “2. Release & Publish”Trigger: New git tag (v*)
Purpose: Build and publish package to npm
Steps:
- Checkout code at tag
- Install dependencies
- Run tests
- Build package
- Publish to npm
- Create GitHub release with changelog
3. PR Validation
Section titled “3. PR Validation”Trigger: Pull request creation/update
Purpose: Validate code quality before merge
Steps:
- Run all tests
- Check linting
- Verify type checking
- Check formatting
- Validate schemas
4. Auto-Merge Bot
Section titled “4. Auto-Merge Bot”Trigger: Version sync PRs
Purpose: Automatically merge version synchronization PRs
Conditions:
- PR created by GitHub Actions
- Title contains “sync package.json version”
- All checks pass
5. Cleanup Workflows
Section titled “5. Cleanup Workflows”Cleanup Old Releases:
- Runs weekly
- Keeps last 10 releases
- Deletes older releases
Cleanup Merged Branches:
- Runs on PR merge
- Deletes merged feature branches
Deployment Checklist
Section titled “Deployment Checklist”- All tests pass
- Linting passes
- Type checking passes
- Documentation updated
- Version bump appropriate
- No breaking changes (unless MAJOR)
- Changelog generated
Monitoring
Section titled “Monitoring”Health Checks
Section titled “Health Checks”Plugin Installation
Section titled “Plugin Installation”# Check if plugin is installedls -la ~/.cache/opencode/node_modules/@pantheon-ai/opencode-warcraft-notifications/
# Check plugin versioncat ~/.cache/opencode/node_modules/@pantheon-ai/opencode-warcraft-notifications/package.json | grep versionSound Files
Section titled “Sound Files”# Check sound directoryls -la ~/.local/share/opencode/storage/plugin/@pantheon-ai/opencode-warcraft-notifications/sounds/
# Count alliance soundsls -1 ~/.local/share/opencode/storage/plugin/@pantheon-ai/opencode-warcraft-notifications/sounds/alliance/ | wc -l
# Count horde soundsls -1 ~/.local/share/opencode/storage/plugin/@pantheon-ai/opencode-warcraft-notifications/sounds/horde/ | wc -lConfiguration
Section titled “Configuration”# Check project configcat .opencode/plugin.json
# Check global configcat ~/.config/opencode/plugin.json
# Check environment variablesecho $SOUNDS_DATA_DIRecho $DEBUG_OPENCODEDebug Logging
Section titled “Debug Logging”Enable debug mode:
DEBUG_OPENCODE=1 opencodeDebug Output:
- Configuration loading attempts
- Sound installation progress
- File operation results
- Event handling
- Error details
Performance Metrics
Section titled “Performance Metrics”Plugin Load Time: < 100ms
Sound Installation Time: < 5s (first run)
Event Response Time: < 50ms
Memory Footprint: < 10MB
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”1. Sound Not Playing
Section titled “1. Sound Not Playing”Symptoms: No sound when session goes idle
Diagnosis:
# Check if sound files existls -la ~/.local/share/opencode/storage/plugin/@pantheon-ai/opencode-warcraft-notifications/sounds/alliance/
# Check platform commandswhich afplay # macOSwhich canberra-gtk-play # Linux
# Test sound playback manuallyafplay ~/.local/share/opencode/storage/plugin/@pantheon-ai/opencode-warcraft-notifications/sounds/alliance/human_selected1.wavSolutions:
- Files missing: Reinstall plugin or manually copy from
data/ - Permission issues:
chmod 644 *.wav - Command missing: Install required packages (see Platform-Specific Setup)
2. Wrong Faction Playing
Section titled “2. Wrong Faction Playing”Symptoms: Horde sounds play when Alliance is configured
Diagnosis:
# Check configurationcat .opencode/plugin.jsoncat ~/.config/opencode/plugin.jsonSolutions:
- Verify
factionsetting in configuration - Check configuration precedence (project > global > default)
- Restart OpenCode after configuration changes
3. Configuration Not Loading
Section titled “3. Configuration Not Loading”Symptoms: Custom configuration ignored
Diagnosis:
# Validate JSON syntaxcat .opencode/plugin.json | jq .
# Check file permissionsls -la .opencode/plugin.jsonSolutions:
- Fix JSON syntax errors
- Ensure file is readable:
chmod 644 .opencode/plugin.json - Verify plugin name matches exactly:
@pantheon-ai/opencode-warcraft-notifications
4. Plugin Not Loading
Section titled “4. Plugin Not Loading”Symptoms: Plugin doesn’t activate
Diagnosis:
# Check if plugin is installedls -la ~/.cache/opencode/node_modules/@pantheon-ai/opencode-warcraft-notifications/
# Check OpenCode configcat ~/.config/opencode/opencode.jsonSolutions:
- Verify plugin is in
opencode.jsonconfiguration - Reinstall plugin: Remove from cache and restart OpenCode
- Check OpenCode logs for errors
5. Notification Not Showing
Section titled “5. Notification Not Showing”Symptoms: Sound plays but no notification appears
Diagnosis:
# Test notification manuallyosascript -e 'display notification "Test" with title "OpenCode"' # macOSnotify-send 'OpenCode' 'Test' # LinuxSolutions:
- macOS: Check System Preferences > Notifications > Script Editor
- Linux: Install
libnotify-binpackage - Check notification permissions
Debug Workflow
Section titled “Debug Workflow”Maintenance
Section titled “Maintenance”Updates
Section titled “Updates”Automatic Updates
Section titled “Automatic Updates”Note: OpenCode does NOT auto-update plugins
Manual Update
Section titled “Manual Update”# Remove plugin from cachecd ~sed -i.bak '/"@pantheon-ai\/opencode-warcraft-notifications"/d' .cache/opencode/package.jsonrm -rf .cache/opencode/node_modules/@pantheon-ai/opencode-warcraft-notifications
# Restart OpenCode (reinstalls latest)opencodeCheck for Updates
Section titled “Check for Updates”# Check current versioncat ~/.cache/opencode/node_modules/@pantheon-ai/opencode-warcraft-notifications/package.json | grep version
# Check latest versionnpm view @pantheon-ai/opencode-warcraft-notifications versionBackup
Section titled “Backup”Configuration Backup
Section titled “Configuration Backup”# Backup project configcp .opencode/plugin.json .opencode/plugin.json.backup
# Backup global configcp ~/.config/opencode/plugin.json ~/.config/opencode/plugin.json.backupSound Files Backup
Section titled “Sound Files Backup”# Backup sound directorytar -czf warcraft-sounds-backup.tar.gz ~/.local/share/opencode/storage/plugin/@pantheon-ai/opencode-warcraft-notifications/sounds/Cleanup
Section titled “Cleanup”Remove Plugin
Section titled “Remove Plugin”# Remove from OpenCode config# Edit ~/.config/opencode/opencode.json and remove plugin entry
# Remove cached pluginrm -rf ~/.cache/opencode/node_modules/@pantheon-ai/opencode-warcraft-notifications
# Remove sound files (optional)rm -rf ~/.local/share/opencode/storage/plugin/@pantheon-ai/opencode-warcraft-notifications/sounds/Clear Cache
Section titled “Clear Cache”# Clear Bun cachebun pm cache rm
# Clear npm cachenpm cache clean --forceSecurity
Section titled “Security”Security Considerations
Section titled “Security Considerations”1. File System Security
Section titled “1. File System Security”Measures:
- No file overwrites (existing files preserved)
- Path validation before operations
- Respect system permissions
- No arbitrary code execution
2. Configuration Security
Section titled “2. Configuration Security”Measures:
- Configuration is pure JSON (no code execution)
- Path sanitization
- Environment variable scoping
- No sensitive data in configuration
3. Network Security
Section titled “3. Network Security”Measures:
- No runtime network operations
- All sounds bundled with package
- No external API calls
- No telemetry or tracking
4. Dependency Security
Section titled “4. Dependency Security”Measures:
- Minimal dependencies
- Regular dependency updates
- Automated security scanning (GitHub Dependabot)
- No known vulnerabilities
Security Best Practices
Section titled “Security Best Practices”- Keep plugin updated: Install security patches promptly
- Verify configuration: Review
plugin.jsonfor unexpected changes - Monitor file permissions: Ensure sound files have appropriate permissions
- Use official sources: Install only from npm registry or official GitHub repository
Reporting Security Issues
Section titled “Reporting Security Issues”Do NOT open public issues for security vulnerabilities.
Contact: security@pantheon-ai.com
Include:
- Description of vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
Operational Procedures
Section titled “Operational Procedures”Deployment Checklist
Section titled “Deployment Checklist”- Version bump appropriate
- All tests pass
- Documentation updated
- Changelog generated
- No breaking changes (unless MAJOR)
- Security scan clean
- Performance acceptable
Rollback Procedure
Section titled “Rollback Procedure”If a release has critical issues:
-
Identify last good version:
Terminal window npm view @pantheon-ai/opencode-warcraft-notifications versions -
Install specific version:
Terminal window # In opencode.json (example version){"plugin": ["@pantheon-ai/opencode-warcraft-notifications@latest"]} -
Report issue: Create GitHub issue with details
-
Fix and release: Follow normal release process
Monitoring Checklist
Section titled “Monitoring Checklist”- Plugin installation successful
- Sound files present
- Configuration loaded correctly
- Events triggering properly
- No errors in logs
- Performance acceptable
Documentation Deployment
Section titled “Documentation Deployment”GitHub Pages
Section titled “GitHub Pages”The project documentation is automatically deployed to GitHub Pages at:
URL: https://pantheon-org.github.io/opencode-warcraft-notifications/
Deployment Architecture
Section titled “Deployment Architecture”The documentation uses GitHub Actions with Astro’s official action:
Key Benefits:
- Official Astro Action: Uses
withastro/action@v3for optimized builds - No branch management: No need to maintain a separate
docsorgh-pagesbranch - Automatic on releases: Documentation updates with every release
- Artifact-based: Uses GitHub’s native Pages deployment
- Concurrent safe: Built-in concurrency control prevents conflicts
- Link verification: Validates all internal links before deployment
Deployment Sources:
./docs/- Source markdown documentation files onmainbranch./pages/- Astro static site generator configuration- Builds are completely ephemeral - no tracking of generated artifacts
Automatic Deployment
Section titled “Automatic Deployment”Documentation is automatically deployed when:
- Releases are published - Documentation updates with each release
- Changes are pushed to
mainbranch in thedocs/**orpages/**directories - Manual workflow dispatch is triggered
Workflow: .github/workflows/deploy-docs.yml
Key Features:
- Static Site Generator: Astro with Starlight theme
- Build Tool: Bun (fast package management and builds)
- Deployment Method: Astro GitHub Action (
withastro/action@v3) with native Pages deployment - Link Verification: Validates all internal links before deployment
- Concurrency Control: Single
pagesgroup prevents overlapping deployments - Permissions: Minimal required permissions (contents: read, pages: write, id-token: write)
Manual Deployment
Section titled “Manual Deployment”To manually trigger documentation deployment:
- Navigate to GitHub Actions
- Click “Run workflow”
- Select branch (usually
main) - Click “Run workflow” button
Expected Duration: 2-5 minutes
Initial Setup
Section titled “Initial Setup”Required: Repository administrator must configure GitHub Pages:
- Go to repository Settings → Pages
- Under Build and deployment, select:
- Source: GitHub Actions
- Save (if required)
Important:
- No branch selection is needed - deployment uses Actions artifacts
- First deployment creates the
github-pagesenvironment automatically - The workflow requires
pages: writeandid-token: writepermissions - The Astro action handles build, upload, and artifact management automatically
Verification
Section titled “Verification”After deployment completes (typically 2-5 minutes):
# Check site is livecurl -I https://pantheon-org.github.io/opencode-warcraft-notifications/ | grep "200 OK"
# Open in browseropen https://pantheon-org.github.io/opencode-warcraft-notifications/
# Check deployment statusgh api repos/:owner/:repo/pages/deployments --jq '.[0] | {status, environment, created_at}'Verification Checklist:
- Documentation site loads at production URL
- Navigation menu works correctly
- All internal links function properly
- Search functionality works
- Images and assets load correctly
- CSS styling is applied
- Mobile view renders correctly
-
github-pagesenvironment shows successful deployment
Build Process
Section titled “Build Process”The documentation build process consists of two jobs:
Job 1: Build
- Setup: Checkout repository and setup Bun runtime
- Dependencies: Install dependencies with frozen lockfile
- Playwright: Install Playwright browsers for testing
- Transform:
pages/transform-docs.jssyncs./docs/→./pages/src/content/docs/ - Build & Upload: Astro action (
withastro/action@v3) handles:- Compiling markdown to HTML with Starlight theme
- Generating static site in
./pages/dist/ - Uploading build artifacts as Pages artifact
- Verification: Validate all internal links in the built site
Job 2: Deploy
- Download: Retrieve Pages artifact from build job
- Deploy: GitHub Actions deploys to Pages service using
actions/deploy-pages@v4 - Environment: Creates/updates
github-pagesenvironment - Summary: Generates deployment summary with URL and build details
Build Configuration: pages/astro.config.mjs
export default defineConfig({ site: 'https://pantheon-org.github.io', base: '/opencode-warcraft-notifications', outDir: './dist', integrations: [ starlight({ title: 'Warcraft Notifications', description: 'OpenCode plugin for Warcraft II notification sounds', // ... sidebar configuration }), ],});Troubleshooting
Section titled “Troubleshooting”Site not accessible:
- Verify GitHub Pages source is set to GitHub Actions (Settings → Pages → Source)
- Check workflow run status in Actions tab
- Verify deployment to
github-pagesenvironment succeeded - Check workflow has required permissions (
pages: write,id-token: write) - Wait 2-5 minutes for deployment to complete
Build failures:
- Check workflow logs in Actions tab (both build and deploy jobs)
- Review Astro build output for errors
- Verify all markdown files have valid frontmatter
- Check for broken internal links
- Ensure dependencies are up to date in
pages/bun.lock
Content not updating:
- Clear browser cache (Ctrl+Shift+R or Cmd+Shift+R)
- Verify changes were committed to
docs/**orpages/**on main branch - Check workflow was triggered (Actions tab)
- Verify both build and deploy jobs completed successfully
- Check deployment environment shows latest deployment
Permissions errors:
- Go to Settings → Actions → General
- Under “Workflow permissions”, ensure:
- “Read and write permissions” is selected, OR
- Pages deployment permissions are explicitly granted
- Manually trigger workflow to retry
Link verification failures:
If internal link verification fails:
# Run link verification locallycd pagesbun run verify
# Check for broken links in the output# Fix any broken links in the source markdown files in ./docs/
# Test the build locallybun run buildBuild artifacts in main branch:
Build artifacts should never appear in the main branch. If you see dist/ or .astro/:
# Ensure .gitignore contains build artifactsecho "dist/" >> .gitignoreecho ".astro/" >> .gitignoreecho "pages/dist/" >> .gitignoreecho "pages/.astro/" >> .gitignore
# Remove from tracking if accidentally committedgit rm -r --cached dist/ pages/dist/ pages/.astro/ .astro/ 2>/dev/null || truegit commit -m "chore: Remove build artifacts from version control"git push origin main
# Clean local working directoryrm -rf dist/ pages/dist/ pages/.astro/ .astro/Monitoring
Section titled “Monitoring”Monitor documentation deployment health:
- Workflow status: GitHub Actions
- Deployment history: Environments → github-pages
- Site availability: Regular HTTP 200 checks
- Build time: Typical deployment takes 2-5 minutes (build + deploy)
- Artifact retention: Build artifacts retained for 90 days
Monitoring Commands:
# Check latest deployment statusgh api repos/:owner/:repo/pages/deployments --jq '.[0]'
# Check workflow runsgh run list --workflow=deploy-docs.yml --limit 5
# View environment deploymentsgh api repos/:owner/:repo/environments/github-pages/deployments --jq '.[]| {created_at, environment, state}'Migration History
Section titled “Migration History”Previous Deployment Method (deprecated):
The project previously used peaceiris/actions-gh-pages@v4 to deploy to a docs branch. This has been replaced with the official Astro GitHub Action.
Current Deployment Method:
Uses withastro/action@v3 which provides:
- Optimized Astro builds
- Automatic artifact upload
- Better caching
- Native GitHub Pages integration
- Built-in link verification
Benefits of Current Approach:
- No branch to maintain or track
- Better concurrency control
- Cleaner git history
- Official Astro support
- Faster builds with caching
- Automatic link verification
Related Documentation
Section titled “Related Documentation”- CI/CD Pipeline - Complete pipeline documentation
- Development Guide - Local documentation development
- GitHub Workflows - Workflow architecture and details
Support
Section titled “Support”Documentation
Section titled “Documentation”- README - Quick start guide
- API Documentation - API reference
- Architecture - System design
- Development Guide - Development workflows
- Live Documentation Site - GitHub Pages
Community
Section titled “Community”- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Questions and discussions
Contact
Section titled “Contact”- Email: support@pantheon-ai.com
- GitHub: @pantheon-org
Document Version: 1.0
Last Updated: 2025-11-10
Maintained By: Pantheon AI Team