From 3525e2df48b6472d976e21f4c6f375ad65361c4b Mon Sep 17 00:00:00 2001 From: webpiratt <213060745+webpiratt@users.noreply.github.com> Date: Tue, 10 Feb 2026 22:02:18 +0300 Subject: [PATCH 1/2] chore: remove auto-deploy, add manual deployment commands - Remove DigitalOcean doctl and auto-deploy from CI workflow - CI now only builds/pushes images and updates manifests with new tags - Add Makefile with kubectl apply commands for manual deployment Co-Authored-By: Claude Opus 4.5 --- .github/workflows/deploy.yaml | 48 +++++++++++++++-------------------- Makefile | 23 +++++++++++++++++ 2 files changed, 44 insertions(+), 27 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 18e61ad..0a12823 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,4 +1,4 @@ -name: Build and Deploy +name: Build and Push Images on: release: @@ -7,7 +7,6 @@ on: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} - CLUSTER: plugins-prod-k8s NS: plugin-fee jobs: @@ -47,39 +46,34 @@ jobs: tag: ${{ github.event.release.tag_name }} additional_tag: latest - deploy: + update-manifests: needs: [build-server, build-worker, build-tx-indexer] runs-on: ubuntu-latest - timeout-minutes: 10 - + permissions: + contents: write steps: - name: Checkout code uses: actions/checkout@v4 - - - name: Install doctl - uses: digitalocean/action-doctl@v2 with: - token: ${{ secrets.DIGITALOCEAN_CI_TOKEN }} - - - name: Save DigitalOcean kubeconfig - run: doctl kubernetes cluster kubeconfig save ${{ env.CLUSTER }} + ref: main - - name: Update deployment files + - name: Update deployment files with new image tags run: | TAG="${{ github.event.release.tag_name }}" - sed -i "s|image: busybox|image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/server:${TAG}|" deploy/01_server.yaml - sed -i "s|image: busybox|image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/worker:${TAG}|" deploy/01_worker.yaml - sed -i "s|image: busybox|image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/tx_indexer:${TAG}|" deploy/01_tx_indexer.yaml - - name: Deploy to Kubernetes + sed -i "s|image: ghcr.io/${{ env.IMAGE_NAME }}/server:.*|image: ghcr.io/${{ env.IMAGE_NAME }}/server:${TAG}|" deploy/01_server.yaml + sed -i "s|image: busybox|image: ghcr.io/${{ env.IMAGE_NAME }}/server:${TAG}|" deploy/01_server.yaml + + sed -i "s|image: ghcr.io/${{ env.IMAGE_NAME }}/worker:.*|image: ghcr.io/${{ env.IMAGE_NAME }}/worker:${TAG}|" deploy/01_worker.yaml + sed -i "s|image: busybox|image: ghcr.io/${{ env.IMAGE_NAME }}/worker:${TAG}|" deploy/01_worker.yaml + + sed -i "s|image: ghcr.io/${{ env.IMAGE_NAME }}/tx_indexer:.*|image: ghcr.io/${{ env.IMAGE_NAME }}/tx_indexer:${TAG}|" deploy/01_tx_indexer.yaml + sed -i "s|image: busybox|image: ghcr.io/${{ env.IMAGE_NAME }}/tx_indexer:${TAG}|" deploy/01_tx_indexer.yaml + + - name: Commit and push updated manifests run: | - kubectl -n ${{ env.NS }} apply -f deploy/prod - kubectl -n ${{ env.NS }} apply -f deploy/01_server.yaml - kubectl -n ${{ env.NS }} apply -f deploy/01_worker.yaml - kubectl -n ${{ env.NS }} apply -f deploy/01_tx_indexer.yaml - - kubectl -n ${{ env.NS }} apply -f deploy/02_grafana_dashboard.yaml - - kubectl -n ${{ env.NS }} rollout status deployment/server --timeout=300s - kubectl -n ${{ env.NS }} rollout status deployment/worker --timeout=300s - kubectl -n ${{ env.NS }} rollout status deployment/tx-indexer --timeout=300s + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add deploy/ + git commit -m "chore: update image tags to ${{ github.event.release.tag_name }}" || echo "No changes to commit" + git push origin main diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..eac8629 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +.PHONY: deploy-prod deploy-server deploy-worker deploy-tx-indexer deploy-grafana + +NS ?= plugin-fee + +deploy-prod: deploy-configs deploy-server deploy-worker deploy-tx-indexer deploy-grafana + +deploy-configs: + kubectl -n $(NS) apply -f deploy/prod + +deploy-server: + kubectl -n $(NS) apply -f deploy/01_server.yaml + kubectl -n $(NS) rollout status deployment/server --timeout=300s + +deploy-worker: + kubectl -n $(NS) apply -f deploy/01_worker.yaml + kubectl -n $(NS) rollout status deployment/worker --timeout=300s + +deploy-tx-indexer: + kubectl -n $(NS) apply -f deploy/01_tx_indexer.yaml + kubectl -n $(NS) rollout status deployment/tx-indexer --timeout=300s + +deploy-grafana: + kubectl -n $(NS) apply -f deploy/02_grafana_dashboard.yaml From 91553b31813b9067c4e34e63bf45cea743e01072 Mon Sep 17 00:00:00 2001 From: webpiratt <213060745+webpiratt@users.noreply.github.com> Date: Tue, 10 Feb 2026 22:06:33 +0300 Subject: [PATCH 2/2] chore: use kubeconfig instead of doctl for dev deployment Replace DIGITALOCEAN_CI_TOKEN with KUBECONFIG_DEV secret (plain YAML) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/deploy-dev.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-dev.yaml b/.github/workflows/deploy-dev.yaml index f992fbe..7aee5e4 100644 --- a/.github/workflows/deploy-dev.yaml +++ b/.github/workflows/deploy-dev.yaml @@ -12,7 +12,6 @@ on: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} - CLUSTER: plugins-dev-k8s NS: plugin-fee jobs: @@ -61,13 +60,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Install doctl - uses: digitalocean/action-doctl@v2 - with: - token: ${{ secrets.DIGITALOCEAN_CI_TOKEN }} - - - name: Save DigitalOcean kubeconfig - run: doctl kubernetes cluster kubeconfig save ${{ env.CLUSTER }} + - name: Set up kubeconfig + run: | + mkdir -p ~/.kube + echo "${{ secrets.KUBECONFIG_DEV }}" > ~/.kube/config + chmod 600 ~/.kube/config - name: Update deployment files run: |