Refactor pipeline script

This commit is contained in:
Murtadha 2024-07-27 21:14:34 -04:00
parent 2af2d81115
commit 5fabaa88e8

View file

@ -1,17 +1,14 @@
---
# kind: pipeline
# type: docker
# name: default
steps:
- name: build
build:
image: node:22
commands:
- npm ci
- npm run build
- echo "VERSION=$(cat version.txt)" > .env
- name: clear-from-host
clear-from-host:
image: appleboy/drone-ssh
settings:
host:
@ -27,7 +24,7 @@ steps:
- find . -maxdepth 1 -type f -delete
- echo "Target directory cleared, resumes folder preserved"
- name: copy-to-host
copy-to-host:
image: appleboy/drone-scp
settings:
host:
@ -43,7 +40,7 @@ steps:
- nginx.conf
- version.txt
- name: deploy
deploy:
image: appleboy/drone-ssh
settings:
host:
@ -73,7 +70,7 @@ steps:
- docker tag nginx:alpine frontend:$VERSION
- echo "Deployment completed"
- name: confirm-deployment
confirm-deployment:
image: appleboy/drone-ssh
settings:
host:
@ -103,7 +100,7 @@ steps:
- curl -I http://localhost:5173 || { echo "HTTP request failed"; exit 1; }
- echo "Deployment confirmed successfully"
- name: cleanup
cleanup:
image: appleboy/drone-ssh
settings:
host: