File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Deploy Static Export
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*' # Triggers on any tag starting with 'v' (e.g., v1.0.0, v1.2.3)
7+ pull_request :
8+ branches : [main] # Build PRs for testing, but don't deploy
9+
10+ jobs :
11+ build :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v4
17+
18+ - name : Setup Node.js
19+ uses : actions/setup-node@v4
20+ with :
21+ node-version : ' 20' # Updated to match project's Node version requirements
22+ cache : ' npm'
23+
24+ - name : Install dependencies
25+ run : npm install
26+
27+ - name : Build static export
28+ run : npm run build # This will run next build which generates the 'out' directory
29+
30+ - name : Deploy to FTP
31+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
32+ uses :
SamKirkland/[email protected] 33+ with :
34+ server : ${{ secrets.FTP_HOST }}
35+ username : ${{ secrets.FTP_USERNAME }}
36+ password : ${{ secrets.FTP_PASSWORD }}
37+ local-dir : ./out/
38+ # Update this to your target directory on the FTP server
39+ server-dir : /www # Change this to your desired directory path on the server
40+
You can’t perform that action at this time.
0 commit comments