Update FTP deployment workflow to copy all files from client and serv… #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy to FTP | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install server dependencies | |
run: cd server && npm install | |
- name: Install client dependencies | |
run: cd client && npm install | |
- name: Build client | |
run: cd client && npm run build | |
- name: Prepare upload directory | |
run: | | |
mkdir -p upload | |
cp -r client/build/* upload/ | |
cp -r server/* upload/ | |
- name: Start server | |
run: nohup npm run start & | |
- name: Upload to FTP server | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
dangerous-clean-slate: true | |
local-dir: ./upload/ | |
server-dir: / |