diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e77433..d00ec88 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,43 +1,25 @@ name: CI-CD -on: +on: push: branches: ["main"] - workflow_dispatch: + workflow_dispatch: # Permite que eu dispare o workflow manualmente jobs: CI: runs-on: ubuntu-latest steps: - name: Obtendo o código - uses: actions/checkout@v4.1.5 + uses: actions/checkout@v4.1.7 - name: Autenticação no Docker Hub - uses: docker/login-action@v3.1.0 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build da Imagem Docker - uses: docker/build-push-action@v5.3.0 + uses: docker/build-push-action@v6.7.0 with: context: ./src file: ./src/Dockerfile push: true - tags: | - fabricioveronez/aula-primeira-pipeline:v${{ github.run_number }} - fabricioveronez/aula-primeira-pipeline:latest - CD: - runs-on: ubuntu-latest - needs: [CI] - steps: - - name: Obtendo o código - uses: actions/checkout@v4.1.5 - - name: Configuração de contexto do Kubernetes - uses: azure/k8s-set-context@v4.0.0 - with: - method: kubeconfig - kubeconfig: ${{ secrets.K8S_CONFIG }} - - name: Execução do Manifesto - uses: Azure/k8s-deploy@v5 - with: - manifests: | - ./k8s/deployment.yaml - images: | - fabricioveronez/aula-primeira-pipeline:v${{ github.run_number }} + tags: | + lucascarmo/aula-primeira-pipeline:v${{ github.run_number }} + lucascarmo/aula-primeira-pipeline:latest