File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy Website
2+
3+ on :
4+ push :
5+ branches : ["main"]
6+
7+ jobs :
8+ deploy :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+
13+ - name : Prepare incoming dir
14+ uses : appleboy/ssh-action@v1.0.3
15+ with :
16+ host : ${{ secrets.DEPLOY_HOST }}
17+ username : ${{ secrets.DEPLOY_USER }}
18+ key : ${{ secrets.DEPLOY_KEY }}
19+ port : ${{ secrets.DEPLOY_PORT }}
20+ script : |
21+ set -e
22+ mkdir -p "${{ secrets.DEPLOY_PATH }}/.incoming"
23+
24+ - name : Rsync upload to incoming
25+ uses : burnett01/rsync-deployments@7.0.1
26+ with :
27+ switches : -avzr --delete
28+ path : ./
29+ remote_path : ${{ secrets.DEPLOY_PATH }}/.incoming/
30+ remote_host : ${{ secrets.DEPLOY_HOST }}
31+ remote_user : ${{ secrets.DEPLOY_USER }}
32+ remote_key : ${{ secrets.DEPLOY_KEY }}
33+ remote_port : ${{ secrets.DEPLOY_PORT }}
34+
35+ - name : Swap into live
36+ uses : appleboy/ssh-action@v1.0.3
37+ with :
38+ host : ${{ secrets.DEPLOY_HOST }}
39+ username : ${{ secrets.DEPLOY_USER }}
40+ key : ${{ secrets.DEPLOY_KEY }}
41+ port : ${{ secrets.DEPLOY_PORT }}
42+ script : |
43+ set -e
44+ TARGET="${{ secrets.DEPLOY_PATH }}"
45+
46+ rsync -a --delete "$TARGET/.incoming/" "$TARGET/"
47+
48+ rm -rf "$TARGET/.incoming"
You can’t perform that action at this time.
0 commit comments