Skip to content

Instantly share code, notes, and snippets.

@rmsaitam
Created February 12, 2026 19:45
Show Gist options
  • Select an option

  • Save rmsaitam/b60fdfeb41cd81b7729b6cd7adf3f105 to your computer and use it in GitHub Desktop.

Select an option

Save rmsaitam/b60fdfeb41cd81b7729b6cd7adf3f105 to your computer and use it in GitHub Desktop.
Deploy site com React
name: Deploy React via FTP
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout do código
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Use a versão do seu projeto
- name: Instalar dependências e Gerar Build
run: |
npm install
npm run build # Isso gera a pasta 'dist' (Vite) ou 'build' (CRA)
- name: Sincronizar via FTP
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
# Importante: Aponte para a pasta gerada no build
local-dir: ./dist/ # Se usar Vite, é 'dist'. Se usar Create React App, é 'build'
server-dir: public_html/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment