Skip to content

Commit 973a98e

Browse files
committed
update
1 parent 8022293 commit 973a98e

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,27 @@ jobs:
2626
run: |
2727
npm run build
2828
29-
- name: Deploy
30-
uses: Dylan700/sftp-upload-action@latest
29+
- name: Compress files
30+
run: |
31+
tar -czf dist.tar.gz www/
32+
33+
- name: Upload and deploy
34+
uses: appleboy/scp-action@master
35+
with:
36+
host: ${{ secrets.HOST }}
37+
username: ${{ secrets.USERNAME }}
38+
password: ${{ secrets.PASSWORD }}
39+
source: "dist.tar.gz"
40+
target: "/tmp"
41+
strip_components: 0
42+
43+
- name: Extract files
44+
uses: appleboy/ssh-action@master
3145
with:
32-
server: ${{ secrets.HOST }}
46+
host: ${{ secrets.HOST }}
3347
username: ${{ secrets.USERNAME }}
34-
password: ${{secrets.PASSWORD}}
35-
uploads: |
36-
www => ${{ secrets.TARGET }}
48+
password: ${{ secrets.PASSWORD }}
49+
script: |
50+
mkdir -p ${{ secrets.TARGET }}
51+
tar -xzf /tmp/dist.tar.gz -C ${{ secrets.TARGET }} --strip-components=1
52+
rm /tmp/dist.tar.gz

0 commit comments

Comments
 (0)