Skip to content

Instantly share code, notes, and snippets.

@kalilinux-png
Last active December 11, 2023 06:02
Show Gist options
  • Save kalilinux-png/ba46ea50bba18488819cdf0f3a60ed86 to your computer and use it in GitHub Desktop.
Save kalilinux-png/ba46ea50bba18488819cdf0f3a60ed86 to your computer and use it in GitHub Desktop.
Deploy React Website
on: push
name: Deploy To Production Server
jobs:
web-deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Build Project
env:
CI: false
run: |
npm install
npm run build
cp ../.htaccess ./build
- name: Sync Files
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{secrets.FTP_USERNAME }}
password: ${{secrets.FTP_PASSWORD }}
local-dir: ./build/
@kalilinux-png
Copy link
Author

This Gist will help you build your react website and upload it to the server using FTP access
you also need to add ftp_server , ftp_username and ftp_password in repo secret's from GitHub settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment