Files
graphs/.gitea/workflows/deploy.yml
Cauê Faleiros 0e5354f1fe
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 3m36s
Initial commit: Dockerized, Postgres, CI/CD pipeline
2026-05-04 14:40:14 -03:00

47 lines
1.3 KiB
YAML

name: Build and Deploy
on:
push:
branches:
- main
env:
REGISTRY: gitea.local # Update this to your real Gitea domain
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Build and push backend image
uses: docker/build-push-action@v4
with:
context: ./backend
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend:latest
- name: Build and push frontend image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend:latest
- name: Trigger Portainer Webhook (Deploy)
run: |
if [ -n "${{ secrets.PORTAINER_WEBHOOK_URL }}" ]; then
echo "Triggering Portainer Webhook..."
curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"
else
echo "No webhook URL found. Skipping auto-deploy. (You can deploy manually in Portainer)"
fi