Skip to content

feat: add github action #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Updated to match project's Node version requirements
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/[email protected]
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