From 74e0bd395c744f91ae992951fc34296145571a65 Mon Sep 17 00:00:00 2001 From: Jhonatan Felipe <155099370+oficialjfdev@users.noreply.github.com> Date: Mon, 11 Nov 2024 16:56:26 -0300 Subject: [PATCH] build and deploy angular para ftp locaweb --- .github/workflows/build-deploy-ftp.yml | 37 ++++++++++++++++++++++++++ .github/workflows/ftp-deploy.yml | 16 ----------- 2 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/build-deploy-ftp.yml delete mode 100644 .github/workflows/ftp-deploy.yml diff --git a/.github/workflows/build-deploy-ftp.yml b/.github/workflows/build-deploy-ftp.yml new file mode 100644 index 0000000..00019f2 --- /dev/null +++ b/.github/workflows/build-deploy-ftp.yml @@ -0,0 +1,37 @@ +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: '16' # Versão do Node.js a ser usada (ajuste conforme necessário) + + - 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, geralmente irá gerar a pasta 'dist/' + + - name: FTP Deploy Locaweb + uses: locaweb/ftp-deploy@1.0.0 + with: + host: ${{ secrets.HOST }} + user: ${{ secrets.USER }} + password: ${{ secrets.PASS }} + localDir: "dist" # Diretório onde o build é gerado pelo Angular (geralmente dist/) + diff --git a/.github/workflows/ftp-deploy.yml b/.github/workflows/ftp-deploy.yml deleted file mode 100644 index 09a20e0..0000000 --- a/.github/workflows/ftp-deploy.yml +++ /dev/null @@ -1,16 +0,0 @@ - name: Deploy via ftp - on: push - jobs: - deploy: - name: Deploy - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: FTP Deploy Locaweb - uses: locaweb/ftp-deploy@1.0.0 - with: - host: ${{ secrets.HOST }} - user: ${{ secrets.USER }} - password: ${{ secrets.PASS }} - localDir: "docs/browser" \ No newline at end of file