kind: pipeline type: docker name: ci-cd-full steps: # Step 1: Build and push image to Gitea Registry - name: docker-build image: plugins/docker pull: always settings: registry: gitea.allowlgroup.ru repo: gitea.allowlgroup.ru/na-granicelife.ru/front tags: - latest - ${DRONE_COMMIT_SHA} username: from_secret: registry_username password: from_secret: registry_password # Step 2: Deploy via SSH - name: ssh-deploy image: appleboy/drone-ssh:1.7 pull: always settings: host: from_secret: deploy_host port: from_secret: deploy_port user: from_secret: deploy_user password: from_secret: deploy_password script_stop: true script: | set -e APP_DIR="$HOME/na-granicelife" TMP_DIR="/tmp/na-granice-deploy" mkdir -p "$APP_DIR/assets/mp4" rm -rf "$TMP_DIR" git clone --depth 1 --branch main https://gitea.allowlgroup.ru/na-granicelife.ru/front.git "$TMP_DIR" tar -C "$TMP_DIR" -cf - --exclude=./.git --exclude=./assets/mp4 . | tar -C "$APP_DIR" -xf - rm -rf "$TMP_DIR" cd "$APP_DIR" docker compose pull web ss -tlnp | grep :3000 || true docker stop na-granicelife 2>/dev/null || true docker compose down --remove-orphans || true docker compose up -d docker image prune -f docker compose ps trigger: branch: - main event: - push - custom