Follow beset practices
This commit is contained in:
parent
72842c822e
commit
e7c59b77bb
1 changed files with 19 additions and 7 deletions
|
|
@ -1,5 +1,8 @@
|
|||
steps:
|
||||
build:
|
||||
when:
|
||||
- branch: master
|
||||
event: push
|
||||
image: node:22
|
||||
commands:
|
||||
- npm ci
|
||||
|
|
@ -7,6 +10,9 @@ steps:
|
|||
- echo "VERSION=$(cat version.txt)" > .env
|
||||
|
||||
clear-from-host:
|
||||
when:
|
||||
- branch: master
|
||||
event: push
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
|
|
@ -21,6 +27,9 @@ steps:
|
|||
- echo "Target directory cleared"
|
||||
|
||||
copy-to-host:
|
||||
when:
|
||||
- branch: master
|
||||
event: push
|
||||
image: appleboy/drone-scp
|
||||
settings:
|
||||
host:
|
||||
|
|
@ -37,6 +46,9 @@ steps:
|
|||
- version.txt
|
||||
|
||||
webserver-deploy:
|
||||
when:
|
||||
- branch: master
|
||||
event: push
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
|
|
@ -67,6 +79,9 @@ steps:
|
|||
- echo "Deployment completed"
|
||||
|
||||
confirm-deployment:
|
||||
when:
|
||||
- branch: master
|
||||
event: push
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
|
|
@ -92,6 +107,9 @@ steps:
|
|||
- echo "Deployment confirmed successfully"
|
||||
|
||||
cleanup:
|
||||
when:
|
||||
- branch: master
|
||||
event: push
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
|
|
@ -110,10 +128,4 @@ steps:
|
|||
for img in $(docker images frontend --format "{{.Tag}}" | grep -v $(cat /home/mnisyif/docker-containers/mnisyif/frontend/version.txt)); do
|
||||
docker rmi frontend:$img || true;
|
||||
done
|
||||
- echo "Cleanup completed"
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
- master
|
||||
- echo "Cleanup completed"
|
||||
Loading…
Add table
Add a link
Reference in a new issue