From 1fc24d9abedfbdd29bd05da5ff89c4e9b1be8e0f Mon Sep 17 00:00:00 2001 From: Firq Date: Sat, 22 Apr 2023 18:31:59 +0200 Subject: [PATCH] Added manual deploy stage in case of server crash --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f3280c0..2f0c1ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ stages: - build - deploy - post_deploy + - scripts .ssh_default: &ssh_default - 'which rsync || ( apk update && apk add rsync )' @@ -106,3 +107,13 @@ maintenance-mode: - echo "Enabeling maintenance mode" - ssh $DEPLOY_USER@$DEPLOY_HOST "screen -S website-firq-npx -dm npx serve maintenance/ -p 9000 -c serve.json" - echo "Maintenance Website is up on https://firq.dev/" + +redeploy-site: + stage: scripts + when: manual + script: + - echo "Stopping screen session" + - ssh $DEPLOY_USER@$DEPLOY_HOST "screen -X -S website-firq-npx kill;" + - echo "Restarting screen session" + - ssh $DEPLOY_USER@$DEPLOY_HOST "screen -S website-firq-npx -dm npx serve public/ -p 9000 -c serve.json" + - echo "Website is up on https://firq.dev/"