Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Wcc723 committed Sep 30, 2023
1 parent b85bc1a commit 1e23100
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy-docker-vps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ jobs:
# 請將 'hostname' 替換為你的服務器地址,例如 IP 地址或域名

- name: Transfer .env file # 上傳環境變數
run: scp .env root@${{ secrets.HOST_NAME }}:/websample/node-env
run: scp .env root@${{ secrets.HOST_NAME }}:/websample/node-env/

- name: Deploy to Docker
run: |
ssh root@${{ secrets.HOST_NAME }} '
docker pull ${{ secrets.DOCKER_HUB_USERNAME }}/github-action-sample:latest
docker rm -f github-ac-sample
docker rm -f github-ac-sample || true
docker run -d -p 3003:3000 --name github-ac-sample --env-file /websample/node-env/.env ${{ secrets.DOCKER_HUB_USERNAME }}/github-action-sample:latest
'
# 這裡假設你的 Docker 容器需要監聽 3000 端口,並且你將這個端口映射到虛擬主機的 3000 端口
Expand Down

0 comments on commit 1e23100

Please sign in to comment.