File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy to DigitalOcean
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout repo
14+ uses : actions/checkout@v3
15+
16+ - name : Setup Node.js
17+ uses : actions/setup-node@v3
18+ with :
19+ node-version : ' 18'
20+
21+ - name : Install dependencies
22+ run : npm install
23+
24+ - name : Build the app
25+ run : npm run build
26+
27+ - name : Copy files to server
28+ 29+ with :
30+ host : ${{ secrets.DO_HOST }}
31+ username : ${{ secrets.DO_USER }}
32+ key : ${{ secrets.DO_SSH_KEY }}
33+ source : " dist"
34+ target : " ${{ secrets.DEPLOY_TARGET_PATH }}temp-build"
35+
36+ - name : Rename and swap build folder via SSH
37+ 38+ with :
39+ host : ${{ secrets.DO_HOST }}
40+ username : ${{ secrets.DO_USER }}
41+ key : ${{ secrets.DO_SSH_KEY }}
42+ script : |
43+ cd ${{ secrets.DEPLOY_TARGET_PATH }}
44+ rm -rf 2025
45+ mv temp-build/dist 2025
46+ rm -rf temp-build
You can’t perform that action at this time.
0 commit comments