GitHub Actions CI/CD Documentation
Complete guide for the automated CI/CD pipelines configured for CS2Inspect.
Overview
The project uses GitHub Actions for automated testing, building, deployment, and Docker image publishing. There are 4 workflows:
- CI Pipeline (
ci.yml) - Tests, lints, and builds on every push/PR - Build Docker Images (
docker.yml) - Builds and pushes Docker images to GHCR - Create Release (
release.yml) - Creates a tagged release and triggers Docker builds - Deploy Documentation (
deploy-docs.yml) - Builds and deploys VitePress docs to GitHub Pages
Workflows
1. CI Pipeline (ci.yml)
Triggers:
- Push to
masterordevbranch - Pull requests to
masterordev - Ignores: markdown files,
docs/,services/docs-site/ - Ignores (push only): workflow files (
docker.yml,release.yml)
Jobs:
Test & Lint
- Runs type checking with TypeScript
- Lints code with ESLint
- Executes test suite with Bun (web app + steam-service)
Build Application
- Builds production bundle with
bun run build - Validates build success
Badge:
2. Build Docker Images (docker.yml)
Triggers:
- Push to
masterordevbranch - Tag push (
v*) - Manual trigger via
workflow_dispatch(with optional platform selection)
Images Built:
| Image | Registry |
|---|---|
| Web App | ghcr.io/sak0a/cs2inspect-web |
| Steam Service | ghcr.io/sak0a/cs2inspect-web-steam-service |
Tag Strategy:
| Trigger | Tags Produced |
|---|---|
Push to master | :latest, :master, :master-{sha} |
Push to dev | :dev, :dev-{sha} |
Tag v1.2.3 | :v1.2.3, :1.2 |
| Manual dispatch | Based on selected ref |
Features:
- GitHub Actions build cache (
type=gha) for fast rebuilds - Docker Buildx for multi-platform support
- Automatic metadata extraction via
docker/metadata-action
Pull Images:
# Latest from master
docker pull ghcr.io/sak0a/cs2inspect-web:latest
docker pull ghcr.io/sak0a/cs2inspect-web-steam-service:latest
# Specific version
docker pull ghcr.io/sak0a/cs2inspect-web:v1.2.3
docker pull ghcr.io/sak0a/cs2inspect-web-steam-service:v1.2.3
# Dev branch
docker pull ghcr.io/sak0a/cs2inspect-web:dev3. Create Release (release.yml)
Trigger: Manual dispatch only (via GitHub Actions UI)
Inputs:
| Input | Description | Required |
|---|---|---|
version | Release version, e.g. 1.2.3 (no v prefix) | Yes |
prerelease | Mark as pre-release | No |
draft | Create as draft | No |
What it does:
- Validates version format (semver:
X.Y.ZorX.Y.Z-suffix) - Checks out
masterbranch - Verifies tag doesn't already exist
- Generates changelog from commits since last tag
- Creates annotated git tag
v{version}and pushes it - Creates a GitHub Release with changelog and Docker pull instructions
- Triggers the Docker build workflow via
gh workflow run docker.yml --ref "v{version}"
Why gh workflow run?
Events created by GITHUB_TOKEN (like tag pushes) don't trigger other workflows. The release workflow works around this by using gh workflow run to explicitly dispatch the Docker build, which is exempt from this restriction.
Usage:
- Go to Actions tab in GitHub
- Select Create Release
- Click Run workflow
- Enter version (e.g.,
1.2.3) - Click Run workflow
After the workflow completes, update your Coolify environment:
WEB_IMAGE_TAG=v1.2.3
SS_IMAGE_TAG=v1.2.34. Deploy Documentation (deploy-docs.yml)
Triggers:
- Push to
masterthat changes:services/docs-site/**,server/api/**,server/types/**,types/**,docs/** - Manual dispatch
What it does:
- Installs docs-site dependencies
- Auto-generates API documentation from source
- Builds VitePress site
- Deploys to GitHub Pages
URL: https://sak0a.github.io/cs2inspect-web/
Deployment Flow
Push to Master (Automatic)
Push to master
│
├──► CI Pipeline (ci.yml)
│ Tests, Lint, Build
│
├──► Build Docker Images (docker.yml)
│ Builds :latest, :master, :master-{sha}
│
└──► Deploy Docs (deploy-docs.yml)
Only if docs/types changedPush to Dev (Automatic)
Push to dev
│
├──► CI Pipeline (ci.yml)
│ Tests, Lint, Build
│
└──► Build Docker Images (docker.yml)
Builds :dev, :dev-{sha}Creating a Release (Manual)
Manual: Create Release
│
├──► Validate version
├──► Create tag v1.2.3
├──► Create GitHub Release
└──► Trigger Docker Build
Builds :v1.2.3, :1.2Configuration
Environment Variables
Set in Settings -> Secrets and variables -> Actions:
# GitHub Token (automatic — no setup needed)
GITHUB_TOKEN=ghp_xxxNo additional secrets are required for CI/CD. The GITHUB_TOKEN is automatically provided by GitHub Actions and has the necessary permissions for:
- Pushing Docker images to GHCR
- Creating tags and releases
- Triggering workflows
- Deploying to GitHub Pages
Workflow Permissions
Required permissions in Settings -> Actions -> General:
- Read and write permissions
- Allow GitHub Actions to create pull requests
Troubleshooting
CI Pipeline Fails
Solutions:
- Run locally:
bun run typecheck && bun run lint && bun test - Check workflow logs in Actions tab
- Fix errors and push again
Docker Build Fails
Solutions:
- Check Dockerfile syntax
- Verify build context paths
- Check GHCR authentication (packages must be accessible)
- Review build cache — try clearing with a manual dispatch
Release Doesn't Trigger Docker Build
The release workflow uses gh workflow run docker.yml to trigger builds. If this fails:
- Check that
actions: writepermission is set in the release workflow - Manually trigger "Build Docker Images" from the Actions tab, selecting the
v*tag as the ref
"manifest unknown" Error in Coolify
This means the Docker image tag doesn't exist in GHCR:
- Go to GitHub -> Actions -> "Build Docker Images" and verify a run completed for that tag
- Check the workflow run summary for the actual tags that were pushed
- Manually trigger a docker build from the Actions tab
Monitoring
View Workflow Status
- Go to Actions tab
- View all workflow runs
- Click a run for detailed logs
Workflow Badges
Add to README.md:

Best Practices
Commit Messages
git commit -m "feat: add new feature"
git commit -m "fix: resolve bug"
git commit -m "docs: update deployment guide"Branch Strategy
master (production)
├── dev (development/staging)
├── feature/xyz (feature branches)
└── fix/abc (bug fixes)- master: Production branch. Pushes build
:latestDocker images. - dev: Development branch. Pushes build
:devDocker images. - feature/fix branches: Merge into
devormastervia PR.
Version Tags
Use the Create Release workflow instead of manually creating tags. It handles tag creation, changelog generation, and Docker image builds in one step.
Quick Start
First Setup
- Push workflow files to repository
- Workflows activate automatically
- Verify in Actions tab
First Release
- Push code to
master— CI runs tests, Docker builds:latest - When ready for a versioned release: Actions -> Create Release -> Enter version -> Run
- Update Coolify env vars with the new version tag
- Redeploy in Coolify