From caede0cfc7326199187c42b4203404fdf625b543 Mon Sep 17 00:00:00 2001 From: Yamamoto Date: Fri, 2 Jan 2026 19:26:45 -0300 Subject: [PATCH] ci: add build workflow for automatic image building --- .forgejo/workflows/build.yaml | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .forgejo/workflows/build.yaml diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..dabf501 --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,57 @@ +name: Build and Push Images + +on: + push: + branches: + - dev + paths: + - 'backend/**' + - 'backoffice/**' + - 'frontend/**' + - 'seeder-api/**' + +env: + REGISTRY: forgejo-gru.rede5.com.br + NAMESPACE: rede5 + +jobs: + build-push: + runs-on: docker + steps: + - name: Checkout code + uses: https://github.com/actions/checkout@v4 + + - name: Login to Forgejo Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.FORGEJO_USERNAME }} + password: ${{ secrets.FORGEJO_PASSWORD }} + + - name: Build and Push Backend + uses: docker/build-push-action@v5 + with: + context: ./backend + push: true + tags: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/gohorsejobs-backend:latest + + - name: Build and Push Frontend + uses: docker/build-push-action@v5 + with: + context: ./frontend + push: true + tags: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/gohorsejobs-frontend:latest + + - name: Build and Push Backoffice + uses: docker/build-push-action@v5 + with: + context: ./backoffice + push: true + tags: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/gohorsejobs-backoffice:latest + + - name: Build and Push Seeder + uses: docker/build-push-action@v5 + with: + context: ./seeder-api + push: true + tags: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/gohorsejobs-seeder:latest