From 28ac44cef22fc7c1b448d94af319e87eb567bcd6 Mon Sep 17 00:00:00 2001 From: Zerohertz Date: Wed, 8 Jan 2025 00:49:03 +0900 Subject: [PATCH] :sparkles: chore: argo cd --- .github/workflows/cicd.yaml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 085a428..fbaf10e 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -8,7 +8,8 @@ on: # - main jobs: - build: + ci: + name: Docker Build runs-on: ubuntu-latest steps: - name: Checkout repository @@ -29,4 +30,25 @@ jobs: ghcr.io/${{ secrets.GH_USERNAME }}/co-co-gong-server:latest, ghcr.io/${{ secrets.GH_USERNAME }}/co-co-gong-server:${{ github.sha }} -# TODO: ghcr.io & Argo CD (related: #22) + cd: + name: Argo CD + needs: ci + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_TOKEN }} + + - name: Change manifest + run: | + sed -i 's|ghcr.io/co-co-gong-server:[^ ]*|ghcr.io/co-co-gong-server:${{ github.sha }}|' k8s/deploy/backend.yaml + + - name: git push + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config credential.helper store + git add k8s/deploy/backend.yaml + git commit -m ":tada: deploy: co-co-gong-server [${{ github.sha }}]" + git push origin ${{ github.ref_name }}