Created
February 12, 2026 19:45
-
-
Save rmsaitam/b60fdfeb41cd81b7729b6cd7adf3f105 to your computer and use it in GitHub Desktop.
Deploy site com React
This file contains hidden or 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: 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