File tree Expand file tree Collapse file tree 4 files changed +48
-4
lines changed Expand file tree Collapse file tree 4 files changed +48
-4
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ version: 2
22updates :
33 - package-ecosystem : " docker-compose"
44 directory : " /"
5- assignees :
6- - " dependabot"
75 labels :
86 - " dependency"
97 - " docker"
Original file line number Diff line number Diff line change @@ -47,10 +47,12 @@ jobs:
4747 let count=count-1
4848 done
4949 echo "OK: Connection established!"
50- - name : Stop services
51- run : sleep 3 && ssh SERVER 'cd ${{ secrets.DEPLOY_PROJECT_DIR }} && docker compose down --remove-orphans '
50+ - name : Run pre-deployment script
51+ run : sleep 3 && ssh SERVER 'cd ${{ secrets.DEPLOY_PROJECT_DIR }} && ./scripts/pre-deploy.sh '
5252 - name : Backup
5353 run : ssh SERVER 'cd ${{ secrets.DEPLOY_PROJECT_DIR }} && ./scripts/backup.sh'
54+ - name : Stop services
55+ run : ssh SERVER 'cd ${{ secrets.DEPLOY_PROJECT_DIR }} && docker compose down --remove-orphans'
5456 - name : Update to latest version
5557 run : ssh SERVER 'cd ${{ secrets.DEPLOY_PROJECT_DIR }} && git checkout prod && git fetch origin prod && git reset --hard origin/prod && docker compose pull'
5658 - name : Start services
6668 let count=count-1
6769 done
6870 echo "OK: Deployment successful!"
71+ - name : Run post-deployment script
72+ run : ssh SERVER 'cd ${{ secrets.DEPLOY_PROJECT_DIR }} && ./scripts/post-deploy.sh'
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+
5+ # # --- Base --- ##
6+ # Getting path of this script file:
7+ _SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd) "
8+ _PROJECT_DIR=" $( cd " ${_SCRIPT_DIR} /.." > /dev/null 2>&1 && pwd) "
9+ cd " ${_PROJECT_DIR} " || exit 2
10+
11+ # Loading .env file (if exists):
12+ if [ -f " .env" ]; then
13+ # shellcheck disable=SC1091
14+ source .env
15+ fi
16+ # # --- Base --- ##
17+
18+
19+ echo " [INFO]: Running post-deploy script..."
20+
21+ echo " [OK]: Done."
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+
5+ # # --- Base --- ##
6+ # Getting path of this script file:
7+ _SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd) "
8+ _PROJECT_DIR=" $( cd " ${_SCRIPT_DIR} /.." > /dev/null 2>&1 && pwd) "
9+ cd " ${_PROJECT_DIR} " || exit 2
10+
11+ # Loading .env file (if exists):
12+ if [ -f " .env" ]; then
13+ # shellcheck disable=SC1091
14+ source .env
15+ fi
16+ # # --- Base --- ##
17+
18+
19+ echo " [INFO]: Running pre-deploy script..."
20+
21+ echo " [OK]: Done."
You can’t perform that action at this time.
0 commit comments