From e3b484812e2f650c45139d88aea4b75e6ee31b1a Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 27 May 2026 15:47:28 +0300 Subject: [PATCH] Update deployment workflows and Docker Compose configurations for cloud-pc, mini-pc, and ru-vps services to specify correct runner labels and improve deployment processes. --- .gitea/workflows/deploy-cloud-pc.yml | 2 +- .gitea/workflows/deploy-mini-pc.yml | 29 ++++++++++++------------ .gitea/workflows/deploy-ru-vps.yml | 29 ++++++++++++------------ cloud-pc/gitea-runner/docker-compose.yml | 1 + mini-pc/gitea-runner/docker-compose.yml | 1 + ru-vps/gitea-runner/docker-compose.yml | 1 + 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.gitea/workflows/deploy-cloud-pc.yml b/.gitea/workflows/deploy-cloud-pc.yml index 58a8b9a..49dc04e 100644 --- a/.gitea/workflows/deploy-cloud-pc.yml +++ b/.gitea/workflows/deploy-cloud-pc.yml @@ -7,7 +7,7 @@ on: jobs: deploy: - runs-on: ubuntu-latest + runs-on: cloud-pc steps: - uses: actions/checkout@v3 with: diff --git a/.gitea/workflows/deploy-mini-pc.yml b/.gitea/workflows/deploy-mini-pc.yml index 3e87aaa..477756c 100644 --- a/.gitea/workflows/deploy-mini-pc.yml +++ b/.gitea/workflows/deploy-mini-pc.yml @@ -7,25 +7,24 @@ on: jobs: deploy: - runs-on: ubuntu-latest + runs-on: mini-pc steps: - uses: actions/checkout@v3 with: fetch-depth: 2 - name: Deploy changed stacks run: | - ssh -o StrictHostKeyChecking=no ${{ secrets.MINI-PC_USER }}@${{ secrets.MINI-PC_HOST }} << 'ENDSSH' + cd /opt/services + git pull + for dir in $(git diff --name-only HEAD~1 HEAD | grep '^mini-pc/' | cut -d/ -f2 | sort -u); do + echo "==> Deploying $dir" + cd /opt/services/mini-pc/$dir + test -f docker-compose.yml || { echo "No docker-compose.yml in $dir, skipping"; cd /opt/services; continue; } + if grep -qE '^[[:space:]]*build:' docker-compose.yml; then + docker compose up -d --build --remove-orphans + else + docker compose pull + docker compose up -d --remove-orphans + fi cd /opt/services - git pull - for dir in $(git diff --name-only HEAD~1 HEAD | grep '^mini-pc/' | cut -d/ -f2 | sort -u); do - echo "==> Deploying $dir" - cd /opt/services/mini-pc/$dir - if grep -qE '^[[:space:]]*build:' docker-compose.yml; then - docker compose up -d --build --remove-orphans - else - docker compose pull - docker compose up -d --remove-orphans - fi - cd /opt/services - done - ENDSSH + done diff --git a/.gitea/workflows/deploy-ru-vps.yml b/.gitea/workflows/deploy-ru-vps.yml index e9bdb15..dc6f050 100644 --- a/.gitea/workflows/deploy-ru-vps.yml +++ b/.gitea/workflows/deploy-ru-vps.yml @@ -7,25 +7,24 @@ on: jobs: deploy: - runs-on: ubuntu-latest + runs-on: ru-vps steps: - uses: actions/checkout@v3 with: fetch-depth: 2 - name: Deploy changed stacks run: | - ssh -o StrictHostKeyChecking=no ${{ secrets.RU-VPS_USER }}@${{ secrets.RU-VPS_HOST }} << 'ENDSSH' + cd /opt/services + git pull + for dir in $(git diff --name-only HEAD~1 HEAD | grep '^ru-vps/' | cut -d/ -f2 | sort -u); do + echo "==> Deploying $dir" + cd /opt/services/ru-vps/$dir + test -f docker-compose.yml || { echo "No docker-compose.yml in $dir, skipping"; cd /opt/services; continue; } + if grep -qE '^[[:space:]]*build:' docker-compose.yml; then + docker compose up -d --build --remove-orphans + else + docker compose pull + docker compose up -d --remove-orphans + fi cd /opt/services - git pull - for dir in $(git diff --name-only HEAD~1 HEAD | grep '^ru-vps/' | cut -d/ -f2 | sort -u); do - echo "==> Deploying $dir" - cd /opt/services/ru-vps/$dir - if grep -qE '^[[:space:]]*build:' docker-compose.yml; then - docker compose up -d --build --remove-orphans - else - docker compose pull - docker compose up -d --remove-orphans - fi - cd /opt/services - done - ENDSSH + done diff --git a/cloud-pc/gitea-runner/docker-compose.yml b/cloud-pc/gitea-runner/docker-compose.yml index 29bc33c..2ceb09f 100644 --- a/cloud-pc/gitea-runner/docker-compose.yml +++ b/cloud-pc/gitea-runner/docker-compose.yml @@ -9,3 +9,4 @@ services: GITEA_INSTANCE_URL: https://git.ada-dev.ru GITEA_RUNNER_REGISTRATION_TOKEN: ${TOKEN} GITEA_RUNNER_NAME: cloud-pc-runner + GITEA_RUNNER_LABELS: cloud-pc diff --git a/mini-pc/gitea-runner/docker-compose.yml b/mini-pc/gitea-runner/docker-compose.yml index b515fbf..98f4a0c 100644 --- a/mini-pc/gitea-runner/docker-compose.yml +++ b/mini-pc/gitea-runner/docker-compose.yml @@ -9,3 +9,4 @@ services: GITEA_INSTANCE_URL: https://git.ada-dev.ru GITEA_RUNNER_REGISTRATION_TOKEN: ${TOKEN} GITEA_RUNNER_NAME: mini-pc-runner + GITEA_RUNNER_LABELS: mini-pc diff --git a/ru-vps/gitea-runner/docker-compose.yml b/ru-vps/gitea-runner/docker-compose.yml index 328cb2f..4179819 100644 --- a/ru-vps/gitea-runner/docker-compose.yml +++ b/ru-vps/gitea-runner/docker-compose.yml @@ -9,3 +9,4 @@ services: GITEA_INSTANCE_URL: https://git.ada-dev.ru GITEA_RUNNER_REGISTRATION_TOKEN: ${TOKEN} GITEA_RUNNER_NAME: ru-vps-runner + GITEA_RUNNER_LABELS: ru-vps