From c565e89d605f7fc11722b9ebc30838785627f358 Mon Sep 17 00:00:00 2001 From: Huarch Date: Fri, 7 Aug 2026 18:00:54 +0800 Subject: [PATCH] =?UTF-8?q?ci(agent):=20=E6=B7=BB=E5=8A=A0=E6=96=B0?= =?UTF-8?q?=E7=89=88=E5=8F=91=E5=B8=83=E4=B8=8E=E4=BC=A0=E8=BE=93=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/deploy-transport-canary.yml | 25 ++++++++++++++++++++ .gitea/workflows/package-v2.yml | 23 ++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .gitea/workflows/deploy-transport-canary.yml create mode 100644 .gitea/workflows/package-v2.yml diff --git a/.gitea/workflows/deploy-transport-canary.yml b/.gitea/workflows/deploy-transport-canary.yml new file mode 100644 index 0000000..dd0527a --- /dev/null +++ b/.gitea/workflows/deploy-transport-canary.yml @@ -0,0 +1,25 @@ +name: Dev deployment transport canary + +on: + workflow_dispatch: + +jobs: + verify-runner-to-dev: + runs-on: ubuntu-22.04 + steps: + - name: Configure restricted deployment key + env: + DEV_DEPLOY_SSH_KEY: ${{ secrets.DEV_DEPLOY_SSH_KEY }} + run: | + set -eu + test -n "$DEV_DEPLOY_SSH_KEY" + install -d -m 700 ~/.ssh + printf '%s\n' "$DEV_DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + ssh-keyscan -H 192.168.1.114 >> ~/.ssh/known_hosts + - name: Verify deployment endpoint and candidate registry pull + run: | + set -eu + ssh -i ~/.ssh/id_ed25519 cicd-deploy@192.168.1.114 verify + ssh -i ~/.ssh/id_ed25519 cicd-deploy@192.168.1.114 \ + 'candidate agent gitea.waternetwork.cn/orgtjwater/tjwateragent:latest' diff --git a/.gitea/workflows/package-v2.yml b/.gitea/workflows/package-v2.yml new file mode 100644 index 0000000..a15666b --- /dev/null +++ b/.gitea/workflows/package-v2.yml @@ -0,0 +1,23 @@ +name: Agent CI/CD v2 + +on: + push: + tags: + - "v*" + workflow_dispatch: {} + +jobs: + build-test-publish-and-deploy: + uses: OrgTJWater/ci-templates/.gitea/workflows/container-cd.yml@main + with: + image_name: gitea.waternetwork.cn/orgtjwater/tjwateragent + dockerfile: Dockerfile + build_context: . + cache_image: gitea.waternetwork.cn/orgtjwater/tjwateragent:ci-cache + test_target: build + deploy_service: agent + deploy_host: 192.168.1.114 + secrets: + REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} + DEV_DEPLOY_SSH_KEY: ${{ secrets.DEV_DEPLOY_SSH_KEY }}