diff --git a/.gitea/deploy-api.yaml b/.gitea/deploy-api.yaml new file mode 100644 index 0000000..eea3ff1 --- /dev/null +++ b/.gitea/deploy-api.yaml @@ -0,0 +1,27 @@ +name: Deploy vendaweb-api +on: [push] + +jobs: + build-and-push-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Login no Harbor + run: | + echo "${{ secrets.HARBOR_PASSWORD }}" | docker login harbor.jurunense.com -u ${{ secrets.HARBOR_USERNAME }} --password-stdin + + - name: Build e Push + run: | + TAG=${{ gitea.sha }} + docker build -t harbor.jurunense.com/library/vendaweb-api:$TAG . + docker tag harbor.jurunense.com/library/vendaweb-api:$TAG harbor.jurunense.com/library/vendaweb-api:latest + + docker push harbor.jurunense.com/library/vendaweb-api:$TAG + docker push harbor.jurunense.com/library/vendaweb-api:latest + + - name: Notificar Portainer via Webhook + run: | + # O Webhook avisa o Portainer para puxar a nova imagem imediatamente + curl -X POST "${{ secrets.PORTAINER_WEBHOOK_VENDAWEBAPI }}" \ No newline at end of file