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 9a3df74 commit 1fa202b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/deploy-docker-vps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ jobs:
- name: Transfer .env file # 上傳環境變數
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 pull ${{ secrets.DOCKER_HUB_USERNAME }}/ironman-app-2023-amd64:latest
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 run -d -p 3003:3000 --name github-ac-sample --env-file ~/websample/node-env/.env ${{ secrets.DOCKER_HUB_USERNAME }}/ironman-app-2023-amd64:latest
'
# 這裡假設你的 Docker 容器需要監聽 3000 端口,並且你將這個端口映射到虛擬主機的 3000 端口
# 其中的 user、hostname、github-action-sample、github-ac-sample、/path/to/your/app/.env,請自行替換成對應的名稱及路徑

0 comments on commit 1fa202b

Please sign in to comment.