From af9368d8cae151774393a4fbc7eba3019f5df015 Mon Sep 17 00:00:00 2001 From: lucasdpt Date: Fri, 10 Apr 2026 23:18:09 +0200 Subject: [PATCH] wip --- .gitea/workflows/deploy.yaml | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..970af80 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,82 @@ +name: Deploy on argocd repo + +on: + workflow_call: + inputs: + server-url: + description: Gitea server URL + required: true + type: string + argocd-repo: + description: ArgoCD repository (owner/repo) + required: true + type: string + file-path: + description: Path to the values/manifest file to update + required: true + type: string + update-helm: + description: Whether to update the Helm chart version + required: false + type: boolean + default: false + update-image: + description: Whether to update the image tag + required: false + type: boolean + default: false + helm-path: + description: yq path to the Helm version field + required: false + type: string + default: .spec.source.targetRevision + helm-version: + description: Helm chart version to set + required: false + type: string + default: "" + image-path: + description: yq path to the image tag field + required: false + type: string + default: "" + image-version: + description: Image tag to set + required: false + type: string + default: "" + secrets: + token: + required: true + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Install yq + run: | + wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 + chmod +x /usr/local/bin/yq + + - name: Checkout ArgoCD repo + uses: actions/checkout@v6 + with: + repository: ${{ inputs.argocd-repo }} + token: ${{ secrets.token }} + github-server-url: ${{ inputs.server-url }} + + - name: Update Helm chart version + if: ${{ inputs.update-helm }} + run: yq e '${{ inputs.helm-path }} = "${{ inputs.helm-version }}"' -i "${{ inputs.file-path }}" + + - name: Update image tag + if: ${{ inputs.update-image }} + run: yq e '${{ inputs.image-path }} = "${{ inputs.image-version }}"' -i "${{ inputs.file-path }}" + + - name: Commit and push changes + run: | + git config user.name "gitea-actions[bot]" + git config user.email "gitea-actions[bot]@noreply.gitea" + git add "${{ inputs.file-path }}" + git diff --cached --quiet || git commit -m "chore: update deployment [skip ci]" + git push \ No newline at end of file