Commit graph

12 commits

Author SHA1 Message Date
f75e42d131 Bugfix/Correct version tagging (#22)
All checks were successful
Build and Publish Docker Image / Publish to Registry (push) Successful in 8s
Build and Publish Docker Image / Deploy to Portainer (push) Successful in 2s
Reviewed-on: #22
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-26 23:07:24 -05:00
e82446cf00 Bugfix/Separate CI files (#15)
All checks were successful
Build and Publish Docker Image / Publish to Registry (push) Successful in 9s
Build and Publish Docker Image / Deploy to Portainer (push) Successful in 2s
Reviewed-on: #15
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-26 16:30:37 -05:00
cec1fccc22 Feature/Refactor to use ecs architecture (#14)
All checks were successful
Build and Publish Docker Image / Build and Validate (push) Successful in 7s
Build and Publish Docker Image / Publish to Registry (push) Successful in 9s
Reviewed-on: #14
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-26 15:39:05 -05:00
712ea7a0c5 Bugfix/deploy to portainer on merge (#12)
All checks were successful
Build and Publish Docker Image / Build and Validate (push) Successful in 7s
Build and Publish Docker Image / Publish to Registry (push) Successful in 9s
- Introduced a new step in the CI workflow to trigger a Portainer deployment using a webhook.
- Added checks for the presence of the PORTAINER_WEBHOOK_URL secret and handled HTTP response codes from the webhook call.
- Ensured that the workflow does not fail if the webhook call is unsuccessful.

This enhancement streamlines the deployment process by automating updates to the Portainer stack upon successful CI runs.

Reviewed-on: #12
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-26 13:23:52 -05:00
21402bf0b4 Feature/new semver tagging logic (#11)
All checks were successful
Build and Publish Docker Image / Build and Validate (push) Successful in 7s
Build and Publish Docker Image / Publish to Registry (push) Successful in 8s
- Introduced a step to validate PR titles, ensuring they start with the correct prefixes (Release/, Feature/, Hotfix/, Bugfix/).
- Enhanced versioning logic to determine version type based on PR title or merge commit message, allowing for appropriate version increments.
- Improved handling of versioning for different types of changes, including major, minor, and patch updates.

This update aims to enforce consistent PR title formatting and streamline version management in the CI process.

Reviewed-on: #11
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-26 13:13:18 -05:00
9adb60d244 Refactor CI workflow to simplify remote URL configuration (#10)
All checks were successful
Build and Publish Docker Image / Build and Validate (push) Successful in 7s
Build and Publish Docker Image / Publish to Registry (push) Successful in 8s
- Removed complex remote URL configuration logic for authentication.
- Updated comments to clarify that the remote should already be configured with the token before pushing to the main branch.

Reviewed-on: #10
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-26 12:52:52 -05:00
7e6eb26fad Hotfix/fix release notes (#9)
All checks were successful
Build and Publish Docker Image / Build and Validate (push) Successful in 9s
Build and Publish Docker Image / Publish to Registry (push) Successful in 9s
- Improved handling of the {{COMMITS}} placeholder to support multi-line content.
- Introduced a while loop for safe replacement of multi-line commit messages.
- Added temporary files for intermediate processing to ensure accurate output.

Reviewed-on: #9
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-26 12:46:30 -05:00
171be2ef17 Hotfix/Fix push version update (#8)
Some checks failed
Build and Publish Docker Image / Build and Validate (push) Successful in 8s
Build and Publish Docker Image / Publish to Registry (push) Failing after 6s
Reviewed-on: #8
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-26 11:58:12 -05:00
28c820488e Feature/Update versioning logic (#7)
All checks were successful
Build and Publish Docker Image / Build and Validate (push) Successful in 8s
Build and Publish Docker Image / Publish to Registry (push) Successful in 7s
Reviewed-on: #7
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-26 11:22:30 -05:00
4bf8897370 Feature/Add workflow summaries (#3)
All checks were successful
Build and Publish Docker Image / Build and Validate (push) Successful in 8s
Build and Publish Docker Image / Publish to Registry (push) Successful in 7s
Reviewed-on: #3
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-25 18:32:17 -05:00
3ac719cfb1 Add release notes template with enhanced tag information
All checks were successful
Build and Publish Docker Image / Build and Validate (pull_request) Successful in 8s
Build and Publish Docker Image / Publish to Registry (pull_request) Has been skipped
2025-11-25 17:31:18 -05:00
b21a0e3a39 Feature/CI Workflow (#1)
All checks were successful
Build and Publish Docker Image / Build and Validate (push) Successful in 6s
Build and Publish Docker Image / Publish to Registry (push) Successful in 6s
# 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

Reviewed-on: #1
Co-authored-by: Juan Sebastian Montoya <juansmm@outlook.com>
Co-committed-by: Juan Sebastian Montoya <juansmm@outlook.com>
2025-11-25 17:21:46 -05:00