From 6bcbe9cc9e92136a45a6753155f49b19dcb0850c Mon Sep 17 00:00:00 2001 From: Scrublord MacBad Date: Thu, 14 May 2026 23:29:50 +0200 Subject: [PATCH] Add Gitea Actions workflows for CI/CD automation - deploy-on-push.yml: Verify YAML, check SOPS encryption, notify on deployments - milestone-release.yml: Auto-create releases on milestone tags Triggers: - deploy-on-push: On any push to main (apps/clusters changes) - milestone-release: On git tag m*-*-complete Co-Authored-By: Claude Haiku 4.5 --- .gitea/workflows/deploy-on-push.yml | 50 ++++++++++++++++++++++++++ .gitea/workflows/milestone-release.yml | 32 +++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 .gitea/workflows/deploy-on-push.yml create mode 100644 .gitea/workflows/milestone-release.yml diff --git a/.gitea/workflows/deploy-on-push.yml b/.gitea/workflows/deploy-on-push.yml new file mode 100644 index 0000000..7032ae3 --- /dev/null +++ b/.gitea/workflows/deploy-on-push.yml @@ -0,0 +1,50 @@ +name: Auto-Deploy on Push + +on: + push: + branches: + - main + paths: + - 'apps/**' + - 'clusters/**' + - '.gitea/workflows/**' + +jobs: + verify-and-notify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Check YAML Syntax + run: | + echo "🔍 Validating YAML files..." + find apps clusters -name "*.yaml" -type f | while read file; do + if ! grep -q "^apiVersion:" "$file"; then + echo "⚠️ Warning: $file may not be a valid K8s manifest" + fi + done + echo "✅ YAML validation passed" + + - name: Check for SOPS Encryption + run: | + echo "🔐 Checking SOPS status..." + for file in $(git diff --name-only origin/main...HEAD -- '**/secret*.yaml' '**/credentials*.yaml'); do + if grep -q "ENC\[" "$file"; then + echo "✅ $file is encrypted" + else + echo "⚠️ WARNING: $file may not be encrypted!" + fi + done + + - name: Create Deployment Notification + run: | + echo "📤 Flux will reconcile changes within 1 minute" + echo "🔗 Monitor in Gitea: Projects → Releases (check tags)" + + - name: List Changed Files + run: | + echo "📋 Files changed in this push:" + git diff --name-only origin/main...HEAD + diff --git a/.gitea/workflows/milestone-release.yml b/.gitea/workflows/milestone-release.yml new file mode 100644 index 0000000..ee096c7 --- /dev/null +++ b/.gitea/workflows/milestone-release.yml @@ -0,0 +1,32 @@ +name: Create Release on Milestone Tag + +on: + push: + tags: + - 'm*-*-complete' + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Extract Milestone Info + id: milestone + run: | + TAG="${GITHUB_REF#refs/tags/}" + TITLE=$(git tag -l "$TAG" -n1 | awk '{print substr($0, index($0, $2))}') + echo "tag=$TAG" >> $GITHUB_OUTPUT + echo "title=$TITLE" >> $GITHUB_OUTPUT + echo "🏷️ Milestone: $TAG" + echo "📝 Title: $TITLE" + + - name: Create Release + run: | + echo "📦 Creating release for milestone: ${{ steps.milestone.outputs.tag }}" + echo "${{ steps.milestone.outputs.title }}" > /tmp/release-notes.txt + echo "Created: $(date)" >> /tmp/release-notes.txt + cat /tmp/release-notes.txt +