Files
whatsappNucleo/.gitea/workflows/deploy.yml
josedario87 37b009f658
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 7m33s
fix: Usar workflow igual a analiticaNucleo (docker build directo)
2025-12-02 18:22:09 -06:00

53 lines
1.8 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: build-and-deploy
on:
push:
branches: [ main, master ]
jobs:
build-and-deploy:
runs-on: docker
env:
REG: ${{ vars.REGISTRY_URL }}
REPO_OWNER: ${{ github.repository_owner }}
APP_NAME: ${{ vars.APP_NAME }}
APP_DOMAIN: ${{ vars.APP_DOMAIN }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
MASTER_API_KEY: ${{ secrets.MASTER_API_KEY }}
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build+push ${{ vars.APP_NAME }}
run: |
docker build -t $REG/${{ github.repository_owner }}/$APP_NAME:${{ github.sha }} -t $REG/${{ github.repository_owner }}/$APP_NAME:latest .
docker push $REG/${{ github.repository_owner }}/$APP_NAME:${{ github.sha }}
docker push $REG/${{ github.repository_owner }}/$APP_NAME:latest
- name: Info about environment
run: |
echo " Deploying ${{ vars.APP_NAME }}"
echo " Domain: ${{ vars.APP_DOMAIN }}"
echo " Image: ${{ vars.REGISTRY_URL }}/${{ github.repository_owner }}/${{ vars.APP_NAME }}:latest"
- name: Pull fresh images
run: docker compose pull
- name: Clean up stack
run: docker compose --project-name $APP_NAME down --remove-orphans || true
- name: Update stack
run: docker compose --project-name $APP_NAME up -d --wait
- name: Health check
run: |
echo "Waiting for application to be ready..."
sleep 15
curl -sf https://${{ vars.APP_DOMAIN }}/api/health || echo "Health check warning - may need more time to start"