From 7b86af9b49881530036483ec5b5004de3aadcdb7 Mon Sep 17 00:00:00 2001 From: Guilherme Biff Zarelli Date: Sat, 26 Apr 2025 18:33:05 -0300 Subject: [PATCH 1/3] feat: add github action --- .github/workflows/deploy.yml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..98a74c0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,42 @@ +name: Build and Deploy Static Export + +on: + push: + branches: [main] + pull_request: + branches: ['*'] + pull_request_target: + types: [closed] + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' # Update this to match your project's Node version + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build static export + run: npm run build # This will run next build which generates the 'out' directory + + - name: Deploy to FTP + if: github.event_name == 'pull_request_target' && github.event.pull_request.merged == true + uses: SamKirkland/FTP-Deploy-Action@4.3.0 + with: + server: ${{ secrets.FTP_HOST }} + username: ${{ secrets.FTP_USERNAME }} + password: ${{ secrets.FTP_PASSWORD }} + local-dir: ./out/ + # Update this to your target directory on the FTP server + server-dir: / # Change this to your desired directory path on the server + From af577f9076097fe47df1f7c8bf527c9cfda667ac Mon Sep 17 00:00:00 2001 From: Guilherme Biff Zarelli Date: Sat, 26 Apr 2025 18:37:21 -0300 Subject: [PATCH 2/3] feat: add github action --- .github/workflows/deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 98a74c0..48cd1b0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,12 +15,12 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '16' # Update this to match your project's Node version + node-version: '20' # Updated to match project's Node version requirements cache: 'npm' - name: Install dependencies From 9b6d46e6db953576a933d0b0a53f7798a705488a Mon Sep 17 00:00:00 2001 From: root Date: Wed, 27 Aug 2025 09:36:42 -0300 Subject: [PATCH 3/3] fix: github actions --- .github/workflows/deploy.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 48cd1b0..bd576ce 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,12 +2,10 @@ name: Build and Deploy Static Export on: push: - branches: [main] + tags: + - 'v*' # Triggers on any tag starting with 'v' (e.g., v1.0.0, v1.2.3) pull_request: - branches: ['*'] - pull_request_target: - types: [closed] - branches: [main] + branches: [main] # Build PRs for testing, but don't deploy jobs: build: @@ -24,13 +22,13 @@ jobs: cache: 'npm' - name: Install dependencies - run: npm ci + run: npm install - name: Build static export run: npm run build # This will run next build which generates the 'out' directory - name: Deploy to FTP - if: github.event_name == 'pull_request_target' && github.event.pull_request.merged == true + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') uses: SamKirkland/FTP-Deploy-Action@4.3.0 with: server: ${{ secrets.FTP_HOST }} @@ -38,5 +36,5 @@ jobs: password: ${{ secrets.FTP_PASSWORD }} local-dir: ./out/ # Update this to your target directory on the FTP server - server-dir: / # Change this to your desired directory path on the server + server-dir: /www # Change this to your desired directory path on the server