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 : Build and Deploy via SFTP
2+
3+ on :
4+ push :
5+ branches : [ main, master ]
6+ workflow_dispatch :
7+
8+ jobs :
9+ build-and-deploy :
10+ runs-on : ubuntu-latest
11+ # 只在指定仓库中运行
12+ if : github.repository == 'langhuihui/m7s-website'
13+
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v4
17+ - name : Install pnpm
18+ uses : pnpm/action-setup@v4
19+ with :
20+ version : latest
21+
22+ - name : Setup Node.js
23+ uses : actions/setup-node@v4
24+ with :
25+ node-version : ' 18'
26+ cache : ' pnpm'
27+
28+ - name : Install dependencies
29+ run : pnpm install
30+
31+ - name : Build project
32+ run : pnpm run build
33+
34+ - name : Deploy to server via SFTP
35+ uses : SamKirkland/FTP-Deploy-Action@v4.3.5
36+ with :
37+ server : ${{ secrets.SFTP_HOST }}
38+ username : ${{ secrets.SFTP_USERNAME }}
39+ password : ${{ secrets.SFTP_PASSWORD }}
40+ port : ${{ secrets.SFTP_PORT }}
41+ protocol : sftp
42+ local-dir : ./.vitepress/dist/
43+ server-dir : ${{ secrets.SFTP_SERVER_DIR }}
44+ exclude : |
45+ **/.git*
46+ **/.git*/**
47+ **/node_modules/**
48+ .env
You can’t perform that action at this time.
0 commit comments