Feature/CI Workflow #1

Merged
jusemon merged 7 commits from feature/ci-workflow into main 2025-11-25 17:21:47 -05:00
Owner

Add CI/CD Pipeline with Docker Build and Publish

Summary

This PR adds a complete CI/CD pipeline for building and publishing Docker images of the Three.js game to the Forgejo container registry. The workflow automatically builds, validates, and publishes Docker images with semantic versioning when code is merged to main.

Changes

🚀 CI/CD Workflow (.forgejo/workflows/ci.yaml)

  • Build & Validation: Automatically builds Docker image on PRs and validates it works
  • Semantic Versioning: Auto-increments patch version on each merge to main
    • First version: 0.1.0 (when no tags exist)
    • Subsequent merges: Auto-increments patch (e.g., 0.1.00.1.10.1.2)
  • Publishing: Publishes images to git.jusemon.com/jusemon/threejs-test:<version> and latest tag
  • Git Tagging: Automatically creates git tags (e.g., v0.1.0) for releases
  • Registry Integration: Uses Forgejo container registry with secrets-based authentication

🐳 Docker Setup

  • Dockerfile: Custom nginx:alpine image with the game HTML file
  • docker-compose.yml: Simple orchestration for local development
  • nginx.conf: Minimal nginx configuration with gzip compression

Workflow Behavior

On Pull Requests

  • Builds Docker image
  • Validates image by running container and checking HTTP response
  • Does NOT publish (validation only)

On Merge to Main

  • Builds Docker image
  • Validates image
  • Publishes to registry with version tag
  • Tags as latest
  • Creates git tag for the release

Required Setup

Before merging, ensure these secrets are configured in the repository:

  • REGISTRY_USERNAME: Forgejo username
  • REGISTRY_PASSWORD: Personal Access Token with package write permissions

Versioning Strategy

  • First Release: 0.1.0 (when no tags exist)
  • Subsequent Releases: Auto-increments patch version on each merge
  • Image Tags:
    • git.jusemon.com/jusemon/threejs-test:0.1.0
    • git.jusemon.com/jusemon/threejs-test:latest (always points to latest main)

Testing

The workflow includes validation steps that:

  1. Build the Docker image
  2. Run a test container
  3. Verify the web server responds correctly
  4. Only publish if all validations pass

Benefits

  • Automated builds and deployments
  • Consistent versioning
  • Image validation before publishing
  • Easy rollback using version tags
  • Latest tag for easy deployment
# Add CI/CD Pipeline with Docker Build and Publish ## Summary This PR adds a complete CI/CD pipeline for building and publishing Docker images of the Three.js game to the Forgejo container registry. The workflow automatically builds, validates, and publishes Docker images with semantic versioning when code is merged to main. ## Changes ### 🚀 CI/CD Workflow (`.forgejo/workflows/ci.yaml`) - **Build & Validation**: Automatically builds Docker image on PRs and validates it works - **Semantic Versioning**: Auto-increments patch version on each merge to main - First version: `0.1.0` (when no tags exist) - Subsequent merges: Auto-increments patch (e.g., `0.1.0` → `0.1.1` → `0.1.2`) - **Publishing**: Publishes images to `git.jusemon.com/jusemon/threejs-test:<version>` and `latest` tag - **Git Tagging**: Automatically creates git tags (e.g., `v0.1.0`) for releases - **Registry Integration**: Uses Forgejo container registry with secrets-based authentication ### 🐳 Docker Setup - **Dockerfile**: Custom nginx:alpine image with the game HTML file - **docker-compose.yml**: Simple orchestration for local development - **nginx.conf**: Minimal nginx configuration with gzip compression ## Workflow Behavior ### On Pull Requests - ✅ Builds Docker image - ✅ Validates image by running container and checking HTTP response - ❌ Does NOT publish (validation only) ### On Merge to Main - ✅ Builds Docker image - ✅ Validates image - ✅ Publishes to registry with version tag - ✅ Tags as `latest` - ✅ Creates git tag for the release ## Required Setup Before merging, ensure these secrets are configured in the repository: - `REGISTRY_USERNAME`: Forgejo username - `REGISTRY_PASSWORD`: Personal Access Token with package write permissions ## Versioning Strategy - **First Release**: `0.1.0` (when no tags exist) - **Subsequent Releases**: Auto-increments patch version on each merge - **Image Tags**: - `git.jusemon.com/jusemon/threejs-test:0.1.0` - `git.jusemon.com/jusemon/threejs-test:latest` (always points to latest main) ## Testing The workflow includes validation steps that: 1. Build the Docker image 2. Run a test container 3. Verify the web server responds correctly 4. Only publish if all validations pass ## Benefits - ✅ Automated builds and deployments - ✅ Consistent versioning - ✅ Image validation before publishing - ✅ Easy rollback using version tags - ✅ Latest tag for easy deployment
jusemon added 2 commits 2025-11-25 15:13:31 -05:00
- Add Dockerfile using nginx:alpine base image
- Add docker-compose.yml for easy container management
- Add nginx.conf with minimal configuration and gzip compression
- Service renamed to 'ui' for better naming convention
Add CI workflow with Docker build and publish
Some checks failed
Build and Publish Docker Image / Build and Publish (pull_request) Failing after 5s
4467c26f17
jusemon added 1 commit 2025-11-25 15:20:38 -05:00
Add dind image
Some checks failed
Build and Publish Docker Image / Build and Publish (pull_request) Failing after 5s
f4d041791c
jusemon added 1 commit 2025-11-25 16:06:24 -05:00
Using -e flag
Some checks failed
Build and Publish Docker Image / Build and Publish (pull_request) Has been cancelled
1f8d8a5d3b
jusemon added 1 commit 2025-11-25 16:38:45 -05:00
Change docker image
Some checks failed
Build and Publish Docker Image / Build and Publish (pull_request) Failing after 2m35s
2b4d02d27f
jusemon added 1 commit 2025-11-25 16:55:59 -05:00
Change docker image
All checks were successful
Build and Publish Docker Image / Build and Publish (pull_request) Successful in 33s
075a3dbded
jusemon added 1 commit 2025-11-25 17:20:55 -05:00
Update ci workflow
All checks were successful
Build and Publish Docker Image / Build and Validate (pull_request) Successful in 7s
Build and Publish Docker Image / Publish to Registry (pull_request) Has been skipped
d53a92d00f
jusemon merged commit b21a0e3a39 into main 2025-11-25 17:21:47 -05:00
jusemon referenced this pull request from a commit 2025-11-25 17:21:48 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jusemon/threejs-test#1
No description provided.