Create generic Forgejo workflow template for Helm and raw manifest deploys #36

Open
opened 2026-07-25 19:37:19 +00:00 by lab · 0 comments
Owner

There are zero .forgejo/workflows/ files. Create a reusable workflow pattern that most services can use with minimal customization.

Two workflow types needed

1. Helm deploy (for services using Helm charts)

name: Deploy {{SERVICE}}
on:
  push:
    paths: ['k3s-ha-cluster/{{SERVICE}}/**']
jobs:
  deploy:
    runs-on: self-hosted
    container:
      image: git.yukselcloud.com/lab/kubectl-node:latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup Kubeconfig
        run: mkdir -p ~/.kube && echo "${{ secrets.KUBECONFIG_DEPLOY }}" > ~/.kube/config
      - name: Helm Upgrade
        run: |
          helm upgrade --install {{SERVICE}} {{CHART}}             --namespace {{NAMESPACE}}             --values k3s-ha-cluster/{{SERVICE}}/values.yaml

2. kubectl apply (for raw manifests)

name: Deploy {{SERVICE}}
on:
  push:
    paths: ['k3s-ha-cluster/{{SERVICE}}/**']
jobs:
  deploy:
    runs-on: self-hosted
    container:
      image: git.yukselcloud.com/lab/kubectl-node:latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup Kubeconfig
        run: mkdir -p ~/.kube && echo "${{ secrets.KUBECONFIG_DEPLOY }}" > ~/.kube/config
      - name: Apply
        run: kubectl apply -n {{NAMESPACE}} -f k3s-ha-cluster/{{SERVICE}}/
      - name: Rollout Restart
        run: kubectl -n {{NAMESPACE}} rollout restart deploy {{DEPLOY_NAME}}

Steps

  1. Create both template variants in k3s-ha-cluster/.forgejo/workflows/
  2. Document which template each service should use
  3. Create per-service workflow files in subsequent issues
There are zero `.forgejo/workflows/` files. Create a reusable workflow pattern that most services can use with minimal customization. ## Two workflow types needed ### 1. Helm deploy (for services using Helm charts) ```yaml name: Deploy {{SERVICE}} on: push: paths: ['k3s-ha-cluster/{{SERVICE}}/**'] jobs: deploy: runs-on: self-hosted container: image: git.yukselcloud.com/lab/kubectl-node:latest steps: - uses: actions/checkout@v4 - name: Setup Kubeconfig run: mkdir -p ~/.kube && echo "${{ secrets.KUBECONFIG_DEPLOY }}" > ~/.kube/config - name: Helm Upgrade run: | helm upgrade --install {{SERVICE}} {{CHART}} --namespace {{NAMESPACE}} --values k3s-ha-cluster/{{SERVICE}}/values.yaml ``` ### 2. kubectl apply (for raw manifests) ```yaml name: Deploy {{SERVICE}} on: push: paths: ['k3s-ha-cluster/{{SERVICE}}/**'] jobs: deploy: runs-on: self-hosted container: image: git.yukselcloud.com/lab/kubectl-node:latest steps: - uses: actions/checkout@v4 - name: Setup Kubeconfig run: mkdir -p ~/.kube && echo "${{ secrets.KUBECONFIG_DEPLOY }}" > ~/.kube/config - name: Apply run: kubectl apply -n {{NAMESPACE}} -f k3s-ha-cluster/{{SERVICE}}/ - name: Rollout Restart run: kubectl -n {{NAMESPACE}} rollout restart deploy {{DEPLOY_NAME}} ``` ## Steps 1. Create both template variants in `k3s-ha-cluster/.forgejo/workflows/` 2. Document which template each service should use 3. Create per-service workflow files in subsequent issues
lab added this to the GitOps & Automation milestone 2026-07-25 19:37:19 +00:00
Sign in to join this conversation.
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
lab/homelab#36
No description provided.