Skip to content

Commit 03eeb49

Browse files
committed
deployment workflow fix
1 parent b34e5a0 commit 03eeb49

1 file changed

Lines changed: 4 additions & 20 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ jobs:
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

0 commit comments

Comments
 (0)