---
title: Forgejo Actions
linkTitle: Forgejo Actions
weight: 40
description: >
  CI/CD actions for automated EdgeConnect deployment and deletion
---

## Overview

The EdgeConnect Actions are custom composite actions for use in [Forgejo](/docs/edp/forgejo/actions/)/[GitHub Actions](https://forgejo.org/docs/latest/user/actions/github-actions/) that automate EdgeConnect application deployments in CI/CD pipelines. They wrap the [EdgeConnect Client](/docs/edgeconnect/edgeconnect-client/) to provide a simple, declarative way to deploy and delete applications without manual CLI installation or configuration.

Two actions are available:
- **edge-connect-deploy-action**: Deploys applications using declarative YAML configuration
- **edge-connect-delete-action**: Deletes applications and their instances from EdgeConnect

## Key Features

* **Zero installation**: Actions automatically download and use the EdgeConnect Client
* **Declarative workflow**: Deploy applications using YAML configuration files
* **CI/CD optimized**: Designed for automated pipelines with auto-approve and dry-run support
* **Version pinning**: Specify exact EdgeConnect Client version for reproducible builds
* **Secrets management**: Credentials passed securely through workflow secrets
* **Compatible with GitHub and Forgejo Actions**: Works in both ecosystems

## Purpose in EDP

CI/CD automation is essential for modern development workflows. While the [EdgeConnect Client](/docs/edgeconnect/edgeconnect-client/) provides powerful deployment capabilities, integrating it into CI/CD pipelines requires downloading binaries, managing credentials, and configuring authentication for each workflow run.

These actions eliminate that boilerplate by:
- Automatically fetching the correct Client version
- Handling authentication setup
- Providing a clean, reusable action interface
- Reducing pipeline configuration to a few lines

This enables teams to focus on application configuration rather than pipeline plumbing, while maintaining the full power of declarative EdgeConnect deployments.

The actions complement the [Terraform provider](/docs/edgeconnect/terraform-provider/) by offering a simpler option for teams already using Forgejo/GitHub Actions who want deployment automation without adopting Terraform.

## Repository

**Deploy Action**: https://edp.buildth.ing/DevFW-CICD/edge-connect-deploy-action

**Delete Action**: https://edp.buildth.ing/DevFW-CICD/edge-connect-delete-action

**Demo Repository**: https://edp.buildth.ing/DevFW-CICD/edgeconnect-action-demo

## Getting Started

### Prerequisites

* Forgejo or GitHub repository with Actions enabled
* EdgeConnect access credentials (username and password)
* `EdgeConnectConfig.yaml` file defining your application (see [YAML Configuration Format](/docs/edgeconnect/edgeconnect-client/#yaml-configuration-format))
* For Kubernetes apps: K8s manifest file referenced in the config
* Repository secrets configured with EdgeConnect credentials

### Quick Start

1. Create an `EdgeConnectConfig.yaml` file in your repository defining your application (see [Client documentation](/docs/edgeconnect/edgeconnect-client/#yaml-configuration-format))
2. Add EdgeConnect credentials as repository secrets:
   - `EDGEXR_PLATFORM_USERNAME`
   - `EDGEXR_PLATFORM_PASSWORD`
3. Create a workflow file (e.g., `.forgejo/workflows/deploy.yaml`) using the action
4. Commit and push to trigger the workflow

### Verification

After the workflow runs successfully:
- Check the workflow logs for deployment status
- Verify resources appear in the [EdgeConnect console](https://hub.apps.edge.platform.mg3.mdb.osc.live/)
- Test application endpoints are accessible

## Usage Examples

### Minimal Deploy Action

```yaml
- name: Deploy to EdgeConnect
  uses: https://edp.buildth.ing/DevFW-CICD/edge-connect-deploy-action@main
  with:
    configFile: ./EdgeConnectConfig.yaml
    baseUrl: https://hub.apps.edge.platform.mg3.mdb.osc.live
    username: ${{ secrets.EDGEXR_PLATFORM_USERNAME }}
    password: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }}
```

### Minimal Delete Action

```yaml
- name: Delete from EdgeConnect
  uses: https://edp.buildth.ing/DevFW-CICD/edge-connect-delete-action@main
  with:
    configFile: ./EdgeConnectConfig.yaml
    baseUrl: https://hub.apps.edge.platform.mg3.mdb.osc.live
    username: ${{ secrets.EDGEXR_PLATFORM_USERNAME }}
    password: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }}
```

### Complete Workflow Example

A typical deployment workflow that builds, tags, and deploys:

```yaml
name: deploy

on:
  workflow_run:
    workflows: [build]
    types:
      - completed
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Update manifest with image tag
        run: |
          sha="${{ github.sha }}"
          shortSha="${sha:0:7}"
          echo "Setting image version to: registry.example.com/myapp:${shortSha}"
          sed -i "s@###IMAGETAG###@registry.example.com/myapp:${shortSha}@g" ./k8s-deployment.yaml

      - name: Deploy to EdgeConnect
        uses: https://edp.buildth.ing/DevFW-CICD/edge-connect-deploy-action@main
        with:
          configFile: ./EdgeConnectConfig.yaml
          baseUrl: https://hub.apps.edge.platform.mg3.mdb.osc.live
          username: ${{ secrets.EDGEXR_PLATFORM_USERNAME }}
          password: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }}
```

### Dry-Run Mode

Preview changes without applying them:

```yaml
- name: Preview deployment
  uses: https://edp.buildth.ing/DevFW-CICD/edge-connect-deploy-action@main
  with:
    configFile: ./EdgeConnectConfig.yaml
    dryRun: 'true'
    baseUrl: https://hub.apps.edge.platform.mg3.mdb.osc.live
    username: ${{ secrets.EDGEXR_PLATFORM_USERNAME }}
    password: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }}
```

### Version Pinning

Use a specific EdgeConnect Client version:

```yaml
- name: Deploy with specific version
  uses: https://edp.buildth.ing/DevFW-CICD/edge-connect-deploy-action@main
  with:
    configFile: ./EdgeConnectConfig.yaml
    version: 'v2.0.1'
    baseUrl: https://hub.apps.edge.platform.mg3.mdb.osc.live
    username: ${{ secrets.EDGEXR_PLATFORM_USERNAME }}
    password: ${{ secrets.EDGEXR_PLATFORM_PASSWORD }}
```

## Integration Points

* **EdgeConnect Client**: Actions download and execute the Client CLI tool
* **EdgeConnect SDK**: Client uses the SDK for all API interactions
* **Forgejo/GitHub Actions**: Native integration with both action ecosystems
* **EdgeConnect API**: All operations communicate with EdgeConnect platform APIs
* **Container Registries**: Works with any registry for application images

## Configuration

### Action Inputs

Both deploy and delete actions accept the same inputs:

| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| `configFile` | Yes | - | Path to EdgeConnectConfig.yaml file |
| `baseUrl` | Yes | - | EdgeConnect API base URL (e.g., https://hub.apps.edge.platform.mg3.mdb.osc.live) |
| `username` | Yes | - | EdgeConnect username for authentication |
| `password` | Yes | - | EdgeConnect password for authentication |
| `dryRun` | No | `false` | Preview changes without applying (set to `'true'` to enable) |
| `version` | No | `v2.0.1` | EdgeConnect Client version to download and use |

### YAML Configuration File

The `configFile` parameter points to an `EdgeConnectConfig.yaml` that defines your application and deployment targets. See the [EdgeConnect Client YAML Configuration Format](/docs/edgeconnect/edgeconnect-client/#yaml-configuration-format) for the complete specification.

Example structure:

```yaml
kind: edgeconnect-deployment
metadata:
  name: "my-app"
  appVersion: "1.0.0"
  organization: "myorg"
spec:
  k8sApp:
    manifestFile: "./k8s-deployment.yaml"
  infraTemplate:
    - region: "EU"
      cloudletOrg: "TelekomOp"
      cloudletName: "Munich"
      flavorName: "EU.small"
```

### Secrets Management

Configure repository secrets in Forgejo/GitHub:

1. Navigate to repository Settings → Secrets
2. Add secrets:
   - Name: `EDGEXR_PLATFORM_USERNAME`, Value: your EdgeConnect username
   - Name: `EDGEXR_PLATFORM_PASSWORD`, Value: your EdgeConnect password
3. Reference in workflows using `${{ secrets.SECRET_NAME }}`

## Troubleshooting

### Action Fails with "Failed to download edge-connect-client"

**Problem**: Action cannot download the Client binary

**Solution**:
- Verify the `version` parameter matches an actual release version
    - Ensure the release exists at https://edp.buildth.ing/DevFW-CICD/edge-connect-client/releases
- Check network connectivity from the runner
- Try using default version by omitting the `version` parameter

### Authentication Errors

**Problem**: "authentication failed" or "unauthorized" errors

**Solution**:
- Verify secrets are correctly configured in repository settings
- Check secret names match exactly (case-sensitive)
- Ensure `baseUrl` is correct for your target environment (Edge vs Orca)
- Confirm credentials work by testing with the [client](../edgeconnect-client/)

### "Configuration validation failed"

**Problem**: YAML configuration file validation errors

**Solution**:
- Verify `configFile` path is correct relative to repository root
- Check YAML syntax is valid (use a YAML validator)
- Ensure all required fields are present (see [Client docs](/docs/edgeconnect/edgeconnect-client/#yaml-configuration-format))
- Verify manifest file paths in the config exist and are correct

### Resources Not Appearing in Console

**Problem**: Action succeeds but resources don't appear in EdgeConnect console

**Solution**:
- Verify you're checking the correct environment (Edge vs Orca)
- Ensure `baseUrl` parameter matches the console you're viewing
- Check organization name in config matches your console access
- Review action logs for any warnings or skipped operations

### Deployment Succeeds but App Doesn't Work

**Problem**: Deployment completes but application is not functioning

**Solution**:
- Check application logs in the EdgeConnect console
- Verify image tags are correct (common issue with placeholder replacement)
- Ensure manifest files reference correct image registry and paths
- Check network configuration allows required outbound connections
- Verify cloudlet has sufficient resources for the specified flavor

## Status

**Maturity**: Production

## Additional Resources

* [EdgeConnect Client Documentation](/docs/edgeconnect/edgeconnect-client/)
* [EdgeConnect SDK Documentation](/docs/edgeconnect/edgeconnect-sdk/)
* [Terraform Provider Documentation](/docs/edgeconnect/terraform-provider/)
* [EdgeConnect Console](https://hub.apps.edge.platform.mg3.mdb.osc.live/)
* [Demo Repository](https://edp.buildth.ing/DevFW-CICD/edgeconnect-action-demo)
* [Forgejo Actions Documentation](https://forgejo.org/docs/latest/user/actions/)
