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