vendaweb-api/.gitea/workflows/deploy-api.yaml

27 lines
950 B
YAML

name: Deploy NestJS 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 10.1.1.124:8082 -u ${{ secrets.HARBOR_USERNAME }} --password-stdin
- name: Build e Push
run: |
TAG=${{ gitea.sha }}
docker build -t 10.1.1.124:8082/library/vendaweb-api:$TAG .
docker tag 10.1.1.124:8082/library/vendaweb-api:$TAG 10.1.1.124:8082/library/vendaweb-api:latest
docker push 10.1.1.124:8082/library/vendaweb-api:$TAG
docker push 10.1.1.124:8082/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 }}"