Files
front/.drone.yml
T
Uroboros 825b3e4d06
continuous-integration/drone/push Build is failing
test4
2026-10-07 21:11:24 +10:00

56 lines
1.4 KiB
YAML

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
docker compose up -d --remove-orphans
docker image prune -f
docker compose ps
trigger:
branch:
- main
event:
- push
- custom