Merge pull request 'add: create build workflow for production and Harbor deployment' (#80) from feature/gitea-actions into development
Reviewed-on: ADUANASOFT/anexo76#80
This commit is contained in:
55
.gitea/workflows/build.yml
Normal file
55
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
name: Build Producción & Push a Harbor
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout código
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login a Harbor
|
||||
run: |
|
||||
echo "${{ secrets.HARBOR_PASSWORD }}" | docker login \
|
||||
dev.aduanasoft.com \
|
||||
-u ${{ secrets.HARBOR_USERNAME }} \
|
||||
--password-stdin
|
||||
|
||||
# ------------------------
|
||||
# Backend
|
||||
# ------------------------
|
||||
- name: Build backend
|
||||
run: |
|
||||
docker build \
|
||||
-t dev.aduanasoft.com/anexo76/backend:latest \
|
||||
-f ./backend/Dockerfile \
|
||||
./backend
|
||||
|
||||
# ------------------------
|
||||
# Frontend
|
||||
# ------------------------
|
||||
- name: Build frontend
|
||||
run: |
|
||||
docker build \
|
||||
--build-arg VITE_API_URL=https://anexo76-dev.aduanasoft.com/api/ \
|
||||
--build-arg VITE_KEYCLOAK_URL=https://anexo76-dev.aduanasoft.com/kcauth/ \
|
||||
--build-arg INTERNAL_API_URL=http://backend:3467/api/ \
|
||||
-t dev.aduanasoft.com/anexo76/frontend:latest \
|
||||
-f ./frontend/Dockerfile.prod \
|
||||
./frontend
|
||||
|
||||
# ------------------------
|
||||
# Push imágenes
|
||||
# ------------------------
|
||||
- name: Push backend
|
||||
run: |
|
||||
docker push dev.aduanasoft.com/anexo76/backend:latest
|
||||
|
||||
- name: Push frontend
|
||||
run: |
|
||||
docker push dev.aduanasoft.com/anexo76/frontend:latest
|
||||
Reference in New Issue
Block a user