File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments