ci: add build workflow for automatic image building
This commit is contained in:
parent
340aa9665e
commit
caede0cfc7
1 changed files with 57 additions and 0 deletions
57
.forgejo/workflows/build.yaml
Normal file
57
.forgejo/workflows/build.yaml
Normal file
|
|
@ -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
|
||||||
Loading…
Reference in a new issue