File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,12 +2,10 @@ name: Build and Deploy Static Export
22
33on :
44 push :
5- branches : [main]
5+ tags :
6+ - ' v*' # Triggers on any tag starting with 'v' (e.g., v1.0.0, v1.2.3)
67 pull_request :
7- branches : ['*']
8- pull_request_target :
9- types : [closed]
10- branches : [main]
8+ branches : [main] # Build PRs for testing, but don't deploy
119
1210jobs :
1311 build :
@@ -24,19 +22,19 @@ jobs:
2422 cache : ' npm'
2523
2624 - name : Install dependencies
27- run : npm ci
25+ run : npm install
2826
2927 - name : Build static export
3028 run : npm run build # This will run next build which generates the 'out' directory
3129
3230 - name : Deploy to FTP
33- if : github.event_name == 'pull_request_target ' && github.event.pull_request.merged == true
31+ if : github.event_name == 'push ' && startsWith( github.ref, 'refs/tags/v')
3432 uses : SamKirkland/FTP-Deploy-Action@4.3.0
3533 with :
3634 server : ${{ secrets.FTP_HOST }}
3735 username : ${{ secrets.FTP_USERNAME }}
3836 password : ${{ secrets.FTP_PASSWORD }}
3937 local-dir : ./out/
4038 # Update this to your target directory on the FTP server
41- server-dir : / # Change this to your desired directory path on the server
39+ server-dir : /www # Change this to your desired directory path on the server
4240
You can’t perform that action at this time.
0 commit comments