aterado teste de conexão FTP #5
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 Angular Project | |
on: | |
push: | |
branches: | |
- main # Ou a branch que você deseja monitorar para o deploy | |
pull_request: | |
branches: | |
- main # Ou a branch para a qual você deseja enviar PRs | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest # Ambiente de execução (Ubuntu) | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 # Faz o checkout do código | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.19.0' # Definindo a versão do Node.js para v18.19 ou superior | |
- name: Install dependencies | |
run: npm install # Instala as dependências do projeto | |
- name: Build Angular project | |
run: npm run build --if-present # Executa o build do Angular | |
- name: Test FTP Connection (Debug) | |
run: | | |
echo "Testing FTP Connection..." | |
echo "FTP connection test" > test.txt # Cria o arquivo de teste | |
curl --ftp-create-dirs -u ${{ secrets.USER }}:${{ secrets.PASS }} ftp://${{ secrets.HOST }}/test.txt -T test.txt || echo "FTP connection failed" | |
rm test.txt # Remove o arquivo de teste após a verificação | |
- name: FTP Deploy Locaweb | |
uses: locaweb/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
user: ${{ secrets.USER }} | |
password: ${{ secrets.PASS }} | |
localDir: "docs/browser" # Ajustado para o localDir correto |