From 42120085a0d6f2834fcb50e5b8e393381c89ff72 Mon Sep 17 00:00:00 2001 From: Murtadha Date: Sun, 14 Jul 2024 02:01:49 -0400 Subject: [PATCH] Change format --- .woodpecker.yml | 94 ++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 264654f..f2de199 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,57 +4,57 @@ name: frontend-deployment steps: - name: build - image: node:22 - commands: - - npm ci - - npm run build + image: node:22 + commands: + - npm ci + - npm run build - name: ssh-copy-to-host - image: appleboy/drone-scp - settings: - host: - from_secret: ssh_host - username: - from_secret: ssh_username - key: - from_secret: ssh_key - port: 2332 - target: /home/mnisyif/docker-containers/mnisyif/frontend - source: - - dist/ - - Dockerfile - - nginx.conf - - version.txt + image: appleboy/drone-scp + settings: + host: + from_secret: ssh_host + username: + from_secret: ssh_username + key: + from_secret: ssh_key + port: 2332 + target: /home/mnisyif/docker-containers/mnisyif/frontend + source: + - dist/ + - Dockerfile + - nginx.conf + - version.txt - name: webserver-docker-deploy - image: appleboy/drone-ssh - settings: - host: - from_secret: ssh_host - username: - from_secret: ssh_username - key: - from_secret: ssh_key - port: 2332 - script: - - cd /home/mnisyif/docker-containers/mnisyif/frontend - - VERSION=$(cat version.txt) - # Build the new Docker image with the current version tag - - docker build -t frontend:$VERSION . - # Stop and remove the existing container if it exists - - docker stop frontend || true - - docker rm frontend || true - # Run the new container with the current version - - docker run -d --name frontend -p 5173:80 frontend:$VERSION - # Remove dangling images - - docker image prune -f - # Clean up unused containers, images, and volumes - - docker system prune -f --volumes - # Remove older versions of the Docker image - - > - for img in $(docker images frontend --format "{{.Tag}}" | grep -v $VERSION); do - docker rmi frontend:$img; - done + image: appleboy/drone-ssh + settings: + host: + from_secret: ssh_host + username: + from_secret: ssh_username + key: + from_secret: ssh_key + port: 2332 + commands: + - cd /home/mnisyif/docker-containers/mnisyif/frontend + - VERSION=$(cat version.txt) + # Build the new Docker image with the current version tag + - docker build -t frontend:$VERSION . + # Stop and remove the existing container if it exists + - docker stop frontend || true + - docker rm frontend || true + # Run the new container with the current version + - docker run -d --name frontend -p 5173:80 frontend:$VERSION + # Remove dangling images + - docker image prune -f + # Clean up unused containers, images, and volumes + - docker system prune -f --volumes + # Remove older versions of the Docker image + - > + for img in $(docker images frontend --format "{{.Tag}}" | grep -v $VERSION); do + docker rmi frontend:$img; + done trigger: event: