Skip to content

Commit 9b6d46e

Browse files
author
root
committed
fix: github actions
1 parent af577f9 commit 9b6d46e

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ name: Build and Deploy Static Export
22

33
on:
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

1210
jobs:
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

0 commit comments

Comments
 (0)