Commit 075be73 1 parent 9d98972 commit 075be73 Copy full SHA for 075be73
File tree 2 files changed +32
-1
lines changed
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Deploy to Server
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 code
14
+ uses : actions/checkout@v2
15
+
16
+ - name : Set up SSH
17
+ uses :
webfactory/[email protected]
18
+ with :
19
+ ssh-private-key : ${{ secrets.SSH_PRIVATE_KEY }}
20
+
21
+ - name : Run deployment script
22
+ env :
23
+ SERVER_IP : ${{ secrets.SERVER_IP }}
24
+ run : |
25
+ ssh -o StrictHostKeyChecking=no deploy@$SERVER_IP << 'EOF'
26
+ export PATH="$PATH:/home/deploy/.nvm/versions/node/v20.18.1/bin"
27
+ cd /home/deploy/blog
28
+ git pull origin main
29
+ pnpm install
30
+ pnpm run build
31
+ EOF
Original file line number Diff line number Diff line change 9
9
"start" : " pnpm dev" ,
10
10
"build:dev" : " cross-env NODE_OPTIONS=--openssl-legacy-provider vuepress build src --dest dist" ,
11
11
"build" : " cross-env NODE_OPTIONS=--openssl-legacy-provider vuepress build src --dest dist" ,
12
- "postbuild" : " mv ./dist/* /var/www/html/"
12
+ "postbuild" : " bash -c '[ -z \" $VERCEL \" ] && mv -f ./dist/* /var/www/html/blog/' "
13
13
},
14
14
"engines" : {
15
15
"node" : " >=18.0.0"
You can’t perform that action at this time.
0 commit comments