From 45100b1c422b8c0ff74d04aed04ecfa1905bfec2 Mon Sep 17 00:00:00 2001 From: proffapt Date: Mon, 15 Apr 2024 20:14:15 +0530 Subject: [PATCH] fix: remote repo syncing --- scripts/cicd.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/cicd.sh b/scripts/cicd.sh index 48b37e6..e24a729 100755 --- a/scripts/cicd.sh +++ b/scripts/cicd.sh @@ -1,7 +1,15 @@ #!/bin/bash +# Make sure we are in the correct directory cd /home/techcoordi/noticeboard || exit 1 -git pull origin main + +# Sync with remote repository +git fetch origin +git reset --hard origin/main + +# Build Stage sudo docker build -t proffapt/noticeboard . + +# Deploy Stage sudo docker-compose down sudo docker-compose up -d