Skip to content

Commit 748bdcf

Browse files
committed
Simplify Dockerfile and add SSH deploy target into GitHub secret
1 parent 6e9a742 commit 748bdcf

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

.github/workflows/deploy-to-vps.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ jobs:
1919
SSH_PRIVATE_KEY: ${{ secrets.VPS_SSH_PRIVATE_KEY }}
2020
REMOTE_HOST: ${{ secrets.VPS_HOST }}
2121
REMOTE_USER: ${{ secrets.VPS_USER }}
22-
TARGET: "~"
22+
TARGET: ${{ secrets.VPS_TARGET }}
2323
SCRIPT_AFTER: |
24-
cp ~/config.py ~/PygameCommunityBot/config.py
25-
cp ~/.env ~/PygameCommunityBot/.env
26-
cd ~/PygameCommunityBot
24+
cp ~/config.py config.py
25+
cp ~/.env .env
2726
docker compose stop
2827
docker compose rm -f
2928
sleep 60

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ RUN apt-get update \
2121

2222
COPY ./pyproject.toml ./requirements.txt ./
2323

24-
FROM builder-base AS pipinstall
25-
2624
RUN mkdir $VENV_PATH \
2725
&& python -m venv $VENV_PATH \
2826
&& . $VENV_PATH/bin/activate \
@@ -31,7 +29,7 @@ RUN mkdir $VENV_PATH \
3129

3230
FROM python-base AS runtime
3331

34-
COPY --from=pipinstall $VENV_PATH $VENV_PATH
32+
COPY --from=builder-base $VENV_PATH $VENV_PATH
3533

3634
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
3735
RUN chmod +x /docker-entrypoint.sh

0 commit comments

Comments
 (0)