Skip to content

Commit 696a985

Browse files
committed
add deploy_static.sh
1 parent 4f89dc0 commit 696a985

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

deploy_static.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
# run on the server side
4+
# you can run in on the action
5+
6+
cd ~/
7+
# to load logfire
8+
source .env
9+
cd python.or.kr
10+
# SHA 환경변수가 없으면 현재 git 커밋의 SHA 값을 가져와서 설정
11+
if [ -z "${SHA}" ]; then
12+
export SHA=$(git rev-parse HEAD)
13+
echo "SHA 환경변수가 없어서 현재 git SHA로 설정: ${SHA}"
14+
fi
15+
source .venv/bin/activate
16+
uv sync
17+
cd pythonkr_backend
18+
export DJANGO_SETTINGS_MODULE="pythonkr_backend.settings.prod"
19+
./manage.py migrate --no-input
20+
./manage.py collectstatic --clear --noinput
21+
./manage.py build
22+
23+
cd ~/bakery_static/build
24+
rsync -arv ./ ~/git-python.or.kr/web/
25+
cd ~/git-python.or.kr/web
26+
git add ./
27+
git commit -m "upload"
28+
git push

0 commit comments

Comments
 (0)