File tree Expand file tree Collapse file tree 3 files changed +63
-1
lines changed Expand file tree Collapse file tree 3 files changed +63
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : pk web site backend deployment
2
+
3
+ on :
4
+ workflow_run :
5
+ workflows : ["pk web site backend testing"]
6
+ types :
7
+ - completed
8
+
9
+ jobs :
10
+ deploy :
11
+ runs-on : ubuntu-latest
12
+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
13
+ steps :
14
+ - name : executing remote ssh commands for update
15
+
16
+ with :
17
+ host : ${{ secrets.HOSTNAME }}
18
+ username : ${{ secrets.USERNAME }}
19
+ key : ${{ secrets.KEY }}
20
+ script :
21
+ cd python.or.kr && git pull
22
+
23
+ - name : executing remote ssh commands for deployment
24
+
25
+ with :
26
+ host : ${{ secrets.HOSTNAME }}
27
+ username : ${{ secrets.USERNAME }}
28
+ key : ${{ secrets.KEY }}
29
+ script :
30
+ cd python.or.kr && bash deploy_prod.sh
31
+
Original file line number Diff line number Diff line change 1
1
# The name of the action
2
- name : pao web site backend testing
2
+ name : pk web site backend testing
3
3
# When the action is triggered
4
4
on :
5
5
push :
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ PID_FILE=" /home/pk/pk.pid"
4
+ LOG_DIR=" /home/pk/logs"
5
+
6
+ cd ~ /
7
+ cd python.or.kr
8
+ # shutdown exist gunicorn
9
+ if [ -f ${PID_FILE} ]; then
10
+ PID=$( cat $PID_FILE )
11
+ kill -TERM $PID
12
+ rm ${PID_FILE}
13
+ fi
14
+
15
+ mkdir -p ${LOG_DIR}
16
+
17
+ # update changes before update
18
+ # git pull
19
+ source .venv/bin/activate
20
+ uv sync
21
+ cd pythonkr_backend
22
+ export DJANGO_SETTINGS_MODULE=" pythonkr_backend.settings.prod"
23
+ ./manage.py migrate --no-input
24
+ ./manage.py collectstatic --clear --noinput
25
+ gunicorn --workers=2 \
26
+ -b :2026 \
27
+ --access-logfile ${LOG_DIR} /access.log \
28
+ --error-logfile ${LOG_DIR} /error.log \
29
+ --daemon \
30
+ --pid ${PID_FILE} \
31
+ pythonkr_backend.wsgi
You can’t perform that action at this time.
0 commit comments