File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 DEPLOY_BRANCH : web-application-version
2323 DEPLOY_PATH : ${{ vars.DEPLOY_PATH }}
2424 IMAGE_NAME : ${{ vars.IMAGE_NAME }}
25- CONTAINER_NAME : ${{ vars.CONTAINER_NAME }}
26- APP_PORT : ${{ vars.APP_PORT }}
2725 with :
2826 host : ${{ secrets.VPS_HOST }}
2927 username : ${{ secrets.VPS_USER }}
@@ -39,25 +37,11 @@ jobs:
3937 git checkout "$DEPLOY_BRANCH"
4038 git reset --hard "origin/$DEPLOY_BRANCH"
4139
42- cd ~/app
43- docker compose up -d mysql_fastapi
44-
45- cd "$DEPLOY_PATH"
4640 docker build -t "$IMAGE_NAME" .
4741
48- docker rm -f "${CONTAINER_NAME}_migrate" >/dev/null 2>&1 || true
49- docker run --rm \
50- --name "${CONTAINER_NAME}_migrate" \
51- --env-file ~/app/.env \
52- -e RUN_MIGRATIONS=1 \
53- "$IMAGE_NAME" true
54-
55- docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
56- docker run -d \
57- --name "$CONTAINER_NAME" \
58- --restart unless-stopped \
59- --env-file ~/app/.env \
60- -p "$APP_PORT:8000" \
61- "$IMAGE_NAME"
42+ cd ~/app
43+ docker compose up -d mysql_fastapi
44+ docker compose run --rm -e RUN_MIGRATIONS=1 fastapi true
45+ docker compose up -d fastapi
6246
6347 docker image prune -f
You can’t perform that action at this time.
0 commit comments