baktainer/.forgejo/README.md

200 lines
6.8 KiB
Markdown
Raw Normal View History

Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
# Forgejo Actions Configuration
This directory contains Forgejo Actions workflows for the Baktainer project. Forgejo Actions provides Continuous Integration similar to GitHub Actions but runs on Forgejo instances.
## Directory Structure
```
.forgejo/
├── workflows/
│ └── ci.yml # Complete CI/CD pipeline
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
└── README.md # This file
```
## Workflow
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
### `ci.yml` - Complete CI/CD Pipeline
- **Triggers**:
- Push to main branch → Test + Build + Deploy
- Version tags (v*.*.*) → Test + Build + Deploy with version tag
- Pull requests → Test only
- **Jobs**: Test → Build → Notify
- **Container**: Ruby 3.3 Alpine (with auto-detection)
- **Features**:
- **Test Job**: Installs dependencies, runs RSpec tests
- **Build Job**: Builds Docker image, pushes to Docker Hub as `:latest` and `:version` (for tags)
- **Notify Job**: Reports pipeline status
- **Pure Shell Commands**: No GitHub Actions dependencies for maximum compatibility
- **Auto-Detection**: Supports multiple package managers (apk, apt-get, yum, dnf)
- **Robust**: Manual git cloning and Docker operations work with any Forgejo runner
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
## Key Differences from GitHub Actions
### 1. Directory Location
- **GitHub**: `.github/workflows/`
- **Forgejo**: `.forgejo/workflows/`
### 2. Runner Types
- Uses `runs-on: docker` for containerized jobs
- Can specify custom container images with `container:`
### 3. Action Compatibility
- Most GitHub Actions work with Forgejo Actions
- Actions are sourced from configured action repositories
- Uses same syntax for `actions/checkout@v4`, `docker/build-push-action@v5`, etc.
### 4. Environment Variables
- Same `${{ github.* }}` variables available
- Same secret management with `${{ secrets.* }}`
## Required Secrets
Configure these secrets in your Forgejo repository settings:
| Secret | Description | Example |
|--------|-------------|---------|
| `DOCKER_USERNAME` | Docker Hub username | `jamez001` |
| `DOCKER_PASSWORD` | Docker Hub password or token | `dckr_pat_...` |
| `DOCKER_IMAGE_NAME` | Docker image name | `jamez001/baktainer` |
## Configuration Requirements
### 1. Enable Repository Actions
1. Go to `/{owner}/{repository}/settings`
2. Click on "Repository" tab
3. Check "Enable Repository Actions"
### 2. Forgejo Runner Setup
- Forgejo Actions requires a separate Forgejo Runner
- Runner must be configured by the Forgejo administrator
- Runner supports Docker, LXC, or host-based execution
### 3. Action Repository Configuration
- Actions are sourced from configured repositories
- Default actions available at https://data.forgejo.org
- Administrator can configure custom action sources
## Workflow Features
### Testing
- **Ruby 3.3** with Alpine Linux
- **RSpec** test suite with progress format
- **Automatic dependency installation** with package manager detection
### Building
- **Docker builds** from Alpine Ruby base
- **Automatic tagging** with `:latest` and version tags (`:v1.2.3`)
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
- **Docker Hub integration** with secure authentication
- **Build status reporting**
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
### Compatibility
- **Pure shell commands** for maximum Forgejo runner compatibility
- **Package manager auto-detection** (apk, apt-get, yum, dnf)
- **No external action dependencies**
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
## Usage Examples
### Manual Workflow Trigger
```bash
# Push to main (triggers full CI/CD: test → build → deploy)
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
git push origin main
# Create and push version tag (triggers test → build → deploy with version tag)
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
git tag v0.1.1
git push origin v0.1.1
# Create pull request (triggers test only)
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
git push origin feature-branch
# Then create PR in Forgejo UI
```
### Monitoring Workflow Status
1. Navigate to repository in Forgejo
2. Click on "Actions" tab
3. View workflow runs and logs
4. Check artifact downloads
## Troubleshooting
### Common Issues
1. **Package manager not found / Node.js executable not found error**
Fix Node.js executable error in Forgejo Actions ## Problem Forgejo Actions failed with error: ``` OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown ``` ## Root Cause GitHub Actions like checkout@v4, cache@v4, and upload-artifact@v4 require Node.js runtime, but Ruby Alpine containers don't include Node.js by default. ## Solutions Implemented ### 1. Updated Existing Workflows - **ci.yml**: Added Node.js installation (`apk add nodejs npm`) - **test.yml**: Added Node.js installation for GitHub Actions compatibility ### 2. New Alternative Workflows - **node-ruby.yml**: Uses Node.js 18 Alpine base with Ruby installed - **simple.yml**: Shell-based workflow avoiding Node.js actions - **minimal.yml**: Minimal test-only workflow with basic shell commands ### 3. Updated Documentation - Added troubleshooting section for Node.js issues - Documented all workflow options with their trade-offs - Provided clear solutions for different use cases ## Workflow Options ### For Full GitHub Actions Support - Use `node-ruby.yml` (Node.js base + Ruby) - Use `ci.yml` or `test.yml` (Ruby base + Node.js installed) ### For Minimal Dependencies - Use `simple.yml` (shell-based, manual git/docker) - Use `minimal.yml` (basic test execution only) ### For Production - Use `node-ruby.yml` for maximum compatibility - Use `simple.yml` for minimal resource usage ## Benefits - **Multiple Options**: Choose workflow based on needs - **Backward Compatibility**: Existing workflows still work - **Minimal Alternatives**: Avoid Node.js dependency if not needed - **Clear Documentation**: Troubleshooting guide for common issues This provides flexibility to use Forgejo Actions with or without Node.js dependencies based on specific requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:18:12 -04:00
```
/var/run/act/workflow/0: line 2: apk: command not found
Fix Node.js executable error in Forgejo Actions ## Problem Forgejo Actions failed with error: ``` OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown ``` ## Root Cause GitHub Actions like checkout@v4, cache@v4, and upload-artifact@v4 require Node.js runtime, but Ruby Alpine containers don't include Node.js by default. ## Solutions Implemented ### 1. Updated Existing Workflows - **ci.yml**: Added Node.js installation (`apk add nodejs npm`) - **test.yml**: Added Node.js installation for GitHub Actions compatibility ### 2. New Alternative Workflows - **node-ruby.yml**: Uses Node.js 18 Alpine base with Ruby installed - **simple.yml**: Shell-based workflow avoiding Node.js actions - **minimal.yml**: Minimal test-only workflow with basic shell commands ### 3. Updated Documentation - Added troubleshooting section for Node.js issues - Documented all workflow options with their trade-offs - Provided clear solutions for different use cases ## Workflow Options ### For Full GitHub Actions Support - Use `node-ruby.yml` (Node.js base + Ruby) - Use `ci.yml` or `test.yml` (Ruby base + Node.js installed) ### For Minimal Dependencies - Use `simple.yml` (shell-based, manual git/docker) - Use `minimal.yml` (basic test execution only) ### For Production - Use `node-ruby.yml` for maximum compatibility - Use `simple.yml` for minimal resource usage ## Benefits - **Multiple Options**: Choose workflow based on needs - **Backward Compatibility**: Existing workflows still work - **Minimal Alternatives**: Avoid Node.js dependency if not needed - **Clear Documentation**: Troubleshooting guide for common issues This provides flexibility to use Forgejo Actions with or without Node.js dependencies based on specific requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:18:12 -04:00
OCI runtime exec failed: exec failed: unable to start container process:
exec: "node": executable file not found in $PATH: unknown
```
**Solutions**:
- **Current workflow uses pure shell commands** - no GitHub Actions dependencies
- **Auto-detects package manager** (apk, apt-get, yum, dnf) for maximum compatibility
- **If still experiencing issues**: Check your Forgejo runner configuration and container image support
Fix Node.js executable error in Forgejo Actions ## Problem Forgejo Actions failed with error: ``` OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown ``` ## Root Cause GitHub Actions like checkout@v4, cache@v4, and upload-artifact@v4 require Node.js runtime, but Ruby Alpine containers don't include Node.js by default. ## Solutions Implemented ### 1. Updated Existing Workflows - **ci.yml**: Added Node.js installation (`apk add nodejs npm`) - **test.yml**: Added Node.js installation for GitHub Actions compatibility ### 2. New Alternative Workflows - **node-ruby.yml**: Uses Node.js 18 Alpine base with Ruby installed - **simple.yml**: Shell-based workflow avoiding Node.js actions - **minimal.yml**: Minimal test-only workflow with basic shell commands ### 3. Updated Documentation - Added troubleshooting section for Node.js issues - Documented all workflow options with their trade-offs - Provided clear solutions for different use cases ## Workflow Options ### For Full GitHub Actions Support - Use `node-ruby.yml` (Node.js base + Ruby) - Use `ci.yml` or `test.yml` (Ruby base + Node.js installed) ### For Minimal Dependencies - Use `simple.yml` (shell-based, manual git/docker) - Use `minimal.yml` (basic test execution only) ### For Production - Use `node-ruby.yml` for maximum compatibility - Use `simple.yml` for minimal resource usage ## Benefits - **Multiple Options**: Choose workflow based on needs - **Backward Compatibility**: Existing workflows still work - **Minimal Alternatives**: Avoid Node.js dependency if not needed - **Clear Documentation**: Troubleshooting guide for common issues This provides flexibility to use Forgejo Actions with or without Node.js dependencies based on specific requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:18:12 -04:00
2. **Working directory not found error**
```
OCI runtime exec failed: exec failed: unable to start container process:
chdir to cwd ("/workspace/james/baktainer/./app") set in config.json failed:
no such file or directory: unknown
```
**Solutions**:
- **Fixed**: Workflow uses explicit `cd app` commands instead of `working-directory` defaults
- The error occurred because `working-directory` was set before repository checkout
- Repository must be cloned before changing to subdirectories
3. **Actions not running**
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
- Check if Repository Actions are enabled
- Verify Forgejo Runner is installed and running
- Check workflow file syntax
Fix Node.js executable error in Forgejo Actions ## Problem Forgejo Actions failed with error: ``` OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown ``` ## Root Cause GitHub Actions like checkout@v4, cache@v4, and upload-artifact@v4 require Node.js runtime, but Ruby Alpine containers don't include Node.js by default. ## Solutions Implemented ### 1. Updated Existing Workflows - **ci.yml**: Added Node.js installation (`apk add nodejs npm`) - **test.yml**: Added Node.js installation for GitHub Actions compatibility ### 2. New Alternative Workflows - **node-ruby.yml**: Uses Node.js 18 Alpine base with Ruby installed - **simple.yml**: Shell-based workflow avoiding Node.js actions - **minimal.yml**: Minimal test-only workflow with basic shell commands ### 3. Updated Documentation - Added troubleshooting section for Node.js issues - Documented all workflow options with their trade-offs - Provided clear solutions for different use cases ## Workflow Options ### For Full GitHub Actions Support - Use `node-ruby.yml` (Node.js base + Ruby) - Use `ci.yml` or `test.yml` (Ruby base + Node.js installed) ### For Minimal Dependencies - Use `simple.yml` (shell-based, manual git/docker) - Use `minimal.yml` (basic test execution only) ### For Production - Use `node-ruby.yml` for maximum compatibility - Use `simple.yml` for minimal resource usage ## Benefits - **Multiple Options**: Choose workflow based on needs - **Backward Compatibility**: Existing workflows still work - **Minimal Alternatives**: Avoid Node.js dependency if not needed - **Clear Documentation**: Troubleshooting guide for common issues This provides flexibility to use Forgejo Actions with or without Node.js dependencies based on specific requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:18:12 -04:00
3. **Docker build failures**
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
- Verify Docker Hub credentials in secrets
- Check Dockerfile syntax
- Ensure runner has Docker access
Fix Node.js executable error in Forgejo Actions ## Problem Forgejo Actions failed with error: ``` OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown ``` ## Root Cause GitHub Actions like checkout@v4, cache@v4, and upload-artifact@v4 require Node.js runtime, but Ruby Alpine containers don't include Node.js by default. ## Solutions Implemented ### 1. Updated Existing Workflows - **ci.yml**: Added Node.js installation (`apk add nodejs npm`) - **test.yml**: Added Node.js installation for GitHub Actions compatibility ### 2. New Alternative Workflows - **node-ruby.yml**: Uses Node.js 18 Alpine base with Ruby installed - **simple.yml**: Shell-based workflow avoiding Node.js actions - **minimal.yml**: Minimal test-only workflow with basic shell commands ### 3. Updated Documentation - Added troubleshooting section for Node.js issues - Documented all workflow options with their trade-offs - Provided clear solutions for different use cases ## Workflow Options ### For Full GitHub Actions Support - Use `node-ruby.yml` (Node.js base + Ruby) - Use `ci.yml` or `test.yml` (Ruby base + Node.js installed) ### For Minimal Dependencies - Use `simple.yml` (shell-based, manual git/docker) - Use `minimal.yml` (basic test execution only) ### For Production - Use `node-ruby.yml` for maximum compatibility - Use `simple.yml` for minimal resource usage ## Benefits - **Multiple Options**: Choose workflow based on needs - **Backward Compatibility**: Existing workflows still work - **Minimal Alternatives**: Avoid Node.js dependency if not needed - **Clear Documentation**: Troubleshooting guide for common issues This provides flexibility to use Forgejo Actions with or without Node.js dependencies based on specific requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:18:12 -04:00
4. **Test failures**
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
- Check Ruby version compatibility
- Verify system dependencies in Alpine
- Review test output in workflow logs
Fix Node.js executable error in Forgejo Actions ## Problem Forgejo Actions failed with error: ``` OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown ``` ## Root Cause GitHub Actions like checkout@v4, cache@v4, and upload-artifact@v4 require Node.js runtime, but Ruby Alpine containers don't include Node.js by default. ## Solutions Implemented ### 1. Updated Existing Workflows - **ci.yml**: Added Node.js installation (`apk add nodejs npm`) - **test.yml**: Added Node.js installation for GitHub Actions compatibility ### 2. New Alternative Workflows - **node-ruby.yml**: Uses Node.js 18 Alpine base with Ruby installed - **simple.yml**: Shell-based workflow avoiding Node.js actions - **minimal.yml**: Minimal test-only workflow with basic shell commands ### 3. Updated Documentation - Added troubleshooting section for Node.js issues - Documented all workflow options with their trade-offs - Provided clear solutions for different use cases ## Workflow Options ### For Full GitHub Actions Support - Use `node-ruby.yml` (Node.js base + Ruby) - Use `ci.yml` or `test.yml` (Ruby base + Node.js installed) ### For Minimal Dependencies - Use `simple.yml` (shell-based, manual git/docker) - Use `minimal.yml` (basic test execution only) ### For Production - Use `node-ruby.yml` for maximum compatibility - Use `simple.yml` for minimal resource usage ## Benefits - **Multiple Options**: Choose workflow based on needs - **Backward Compatibility**: Existing workflows still work - **Minimal Alternatives**: Avoid Node.js dependency if not needed - **Clear Documentation**: Troubleshooting guide for common issues This provides flexibility to use Forgejo Actions with or without Node.js dependencies based on specific requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:18:12 -04:00
5. **GitHub Actions compatibility**
- **Not applicable**: Current workflow uses only shell commands
- **No external actions**: Maximum compatibility with any Forgejo runner
Fix Node.js executable error in Forgejo Actions ## Problem Forgejo Actions failed with error: ``` OCI runtime exec failed: exec failed: unable to start container process: exec: "node": executable file not found in $PATH: unknown ``` ## Root Cause GitHub Actions like checkout@v4, cache@v4, and upload-artifact@v4 require Node.js runtime, but Ruby Alpine containers don't include Node.js by default. ## Solutions Implemented ### 1. Updated Existing Workflows - **ci.yml**: Added Node.js installation (`apk add nodejs npm`) - **test.yml**: Added Node.js installation for GitHub Actions compatibility ### 2. New Alternative Workflows - **node-ruby.yml**: Uses Node.js 18 Alpine base with Ruby installed - **simple.yml**: Shell-based workflow avoiding Node.js actions - **minimal.yml**: Minimal test-only workflow with basic shell commands ### 3. Updated Documentation - Added troubleshooting section for Node.js issues - Documented all workflow options with their trade-offs - Provided clear solutions for different use cases ## Workflow Options ### For Full GitHub Actions Support - Use `node-ruby.yml` (Node.js base + Ruby) - Use `ci.yml` or `test.yml` (Ruby base + Node.js installed) ### For Minimal Dependencies - Use `simple.yml` (shell-based, manual git/docker) - Use `minimal.yml` (basic test execution only) ### For Production - Use `node-ruby.yml` for maximum compatibility - Use `simple.yml` for minimal resource usage ## Benefits - **Multiple Options**: Choose workflow based on needs - **Backward Compatibility**: Existing workflows still work - **Minimal Alternatives**: Avoid Node.js dependency if not needed - **Clear Documentation**: Troubleshooting guide for common issues This provides flexibility to use Forgejo Actions with or without Node.js dependencies based on specific requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:18:12 -04:00
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
### Debugging Steps
1. **Check workflow syntax**:
```bash
# Validate YAML syntax
yamllint .forgejo/workflows/ci.yml
```
2. **Test locally**:
```bash
# Run tests in similar environment
docker run --rm -v $(pwd):/app -w /app ruby:3.3-alpine sh -c \
"apk add --no-cache build-base libffi-dev linux-headers postgresql-dev git && \
cd app && bundle install && bundle exec rspec"
```
3. **Check logs**:
- View detailed logs in Forgejo Actions UI
- Check runner logs on server
- Verify secret configuration
## Migration from GitHub Actions
This workflow is designed to be compatible with the existing GitHub Actions in `.github/workflows/`. Key adaptations made:
1. **Pure shell commands**: No external action dependencies for maximum compatibility
2. **Runner specification**: Uses `docker` with Ruby 3.3 Alpine container
3. **Package manager detection**: Auto-detects apk, apt-get, yum, or dnf
4. **Manual operations**: Git clone and Docker commands work with any runner setup
Both GitHub Actions and Forgejo Actions can coexist in the same repository, allowing for gradual migration or dual CI/CD setup.
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
## Simplified Design
Add Forgejo Actions workflows for CI/CD ## Forgejo Actions Setup ### Directory Structure - `.forgejo/workflows/` - Forgejo Actions workflows directory - `ci.yml` - Main CI pipeline (test + build + notify) - `test.yml` - Test-only workflow for development - `build.yml` - Build-only workflow for releases - `docker.yml` - Advanced Docker workflow with caching - `README.md` - Comprehensive documentation ### Key Features #### 1. Main CI Pipeline (ci.yml) - Runs RSpec tests in Ruby 3.3 Alpine container - Builds and pushes Docker images to Docker Hub - Supports version tagging and latest tags - Provides pipeline status notifications #### 2. Test Workflow (test.yml) - Dedicated testing workflow for PRs - Runs unit and integration tests separately - Generates coverage reports - Uploads test artifacts #### 3. Build Workflow (build.yml) - Standalone Docker build workflow - Triggers on main branch and version tags - Includes build status notifications #### 4. Advanced Docker Workflow (docker.yml) - Uses Docker Buildx for advanced builds - Implements Docker layer caching - Automatic metadata extraction and tagging ### Forgejo vs GitHub Actions Differences #### Technical Adaptations - **Directory**: `.forgejo/workflows/` vs `.github/workflows/` - **Runners**: `runs-on: docker` with container specification - **Dependencies**: Explicit Alpine package installation - **Caching**: Adapted for Forgejo environment - **Execution**: Optimized for Docker container runtime #### Compatibility - Uses same action references (`actions/checkout@v4`, etc.) - Same secret management (`${{ secrets.* }}`) - Same environment variables (`${{ github.* }}`) - Maintains workflow syntax compatibility ### Required Configuration - Enable Repository Actions in Forgejo settings - Configure Docker Hub secrets (DOCKER_USERNAME, DOCKER_PASSWORD, DOCKER_IMAGE_NAME) - Ensure Forgejo Runner is installed and configured - Set up action repository sources ### Benefits - **Dual CI/CD**: Can run alongside GitHub Actions - **Self-hosted**: Full control over CI/CD infrastructure - **Docker-native**: Optimized for containerized workflows - **Feature parity**: Maintains same functionality as GitHub Actions This enables Baktainer to run on Forgejo instances with full CI/CD capabilities while maintaining compatibility with existing GitHub Actions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:02:58 -04:00
This single workflow replaces multiple complex workflows with one simple, reliable pipeline that:
- **Tests** your Ruby application with RSpec
- **Builds** a Docker image
- **Deploys** by pushing to Docker Hub with proper tagging
- **Works** with any Forgejo runner configuration