feat: drone
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Sabda Yagra 2026-02-19 14:07:37 +07:00
parent 8e29c7a58b
commit 67e7c1be45
1 changed files with 44 additions and 0 deletions

44
.drone.yml Normal file
View File

@ -0,0 +1,44 @@
kind: pipeline
type: ssh
name: kontenhumas-fe-build-deploy
server:
host:
from_secret: ssh_host
user:
from_secret: ssh_user
ssh_key:
from_secret: ssh_key
steps:
- name: prepare repo
when:
branch:
- dev-1
- main
commands:
- rm -rf /opt/build/kontenhumas-fe
- mkdir -p /opt/build
- cd /opt/build
- git clone http://38.47.180.165:3000/kontenhumas/kontenhumas-fe.git
- name: build image
when:
branch:
- dev-1
- main
commands:
- docker login 38.47.180.165:3000 -u administrator -p HarborDockerImageRep0
- cd /opt/build/kontenhumas-fe
- docker build -t 38.47.180.165:3000/kontenhumas/kontenhumas-fe:$DRONE_BRANCH .
- docker push 38.47.180.165:3000/kontenhumas/kontenhumas-fe:$DRONE_BRANCH
- name: deploy
when:
branch:
- main
commands:
- docker pull 38.47.180.165:3000/kontenhumas/kontenhumas-fe:$DRONE_BRANCH
- docker stop new-netidhub || true
- docker rm new-netidhub || true
- docker run -dt -p 4242:3000 --restart always --name new-netidhub 38.47.180.165:3000/kontenhumas/kontenhumas-fe:$DRONE_BRANCH