Skip to content

Commit c90e0fb

Browse files
committed
fix: update deploy workflow
1 parent abc93d9 commit c90e0fb

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- main
77

8+
env:
9+
DEPLOY_PATH: /home/${{ secrets.USERNAME }}/projects/link-manager-api
10+
811
jobs:
912
build_and_push:
1013
runs-on: ubuntu-latest
@@ -24,24 +27,23 @@ jobs:
2427
docker push axlz/link-manager-api
2528
2629
- name: Send compose.yml to VPS
27-
uses: appleboy/scp-action@master
30+
uses: appleboy/scp-action@v1
2831
with:
2932
host: ${{ secrets.HOST }}
3033
username: ${{ secrets.USERNAME }}
3134
password: ${{ secrets.PASSWORD }}
3235
port: ${{ secrets.PORT }}
3336
source: "compose.yml"
34-
target: "/home/${{ secrets.USERNAME }}/link-manager-api"
37+
target: ${{ env.DEPLOY_PATH }}
3538

3639
- name: Deploy to VPS
37-
uses: appleboy/ssh-action@master
40+
uses: appleboy/ssh-action@v1
3841
with:
3942
host: ${{ secrets.HOST }}
4043
username: ${{ secrets.USERNAME }}
4144
password: ${{ secrets.PASSWORD }}
4245
port: ${{ secrets.PORT }}
4346
script: |
44-
docker pull axlz/link-manager-api
45-
cd link-manager-api
47+
cd $DEPLOY_PATH
4648
echo "${{ secrets.ENV_FILE }}" > .env
47-
docker compose up -d --build --force-recreate
49+
docker compose up -d --pull always --force-recreate

0 commit comments

Comments
 (0)