From 36997a577bf2ec93934c3479193ada495773fbbe Mon Sep 17 00:00:00 2001 From: Smile Rex Date: Sun, 20 Jul 2025 22:53:47 +0300 Subject: [PATCH] del workflow --- .github/workflows/ci.yml | 61 ---------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 7a25770..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Deploy to Docker Swarm (Worker Node) - -on: - push: - branches: [main] - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - - name: Build and push Docker image - run: | - docker build -t ghcr.io/serverussnap/imagegenerator:latest . - echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u serverussnap --password-stdin - docker push ghcr.io/serverussnap/imagegenerator:latest - - - name: Add SSH key to known_hosts - run: | - mkdir -p ~/.ssh - ssh-keyscan -H ${{ secrets.VM_HOST }} >> ~/.ssh/known_hosts - - - name: Setup SSH key - run: | - mkdir -p ~/.ssh - echo "${{ secrets.VM_SSH_KEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - - - name: Test SSH connection - run: | - ssh -v -i ~/.ssh/id_rsa ${{ secrets.VM_USER }}@${{ secrets.VM_HOST }} "echo 'SSH Connection successful!'" - - - name: Deploy to Swarm Worker Node - uses: appleboy/ssh-action@v1.0.0 - with: - host: ${{ secrets.VM_HOST }} - username: ${{ secrets.VM_USER }} - key: ${{ secrets.VM_SSH_KEY }} - script: | - docker login ghcr.io -u serverussnap -p ${{ secrets.GHCR_TOKEN }} - - if docker service inspect imagegenerator_service >/dev/null 2>&1; then - docker service update \ - --image ghcr.io/serverussnap/imagegenerator:latest \ - --publish-add 3050:3000 \ - --constraint node.hostname==worker \ - --with-registry-auth \ - imagegenerator_service - else - docker service create \ - --name imagegenerator_service \ - --publish 3050:3000 \ - --constraint node.hostname==worker \ - --with-registry-auth \ - ghcr.io/serverussnap/imagegenerator:latest - fi - - docker image prune -a -f