Añadir workloads/ecommerce/build.yaml
En tu repositorio de código (donde tienes el Dockerfile y el index.html), debes crear una carpeta .gitea/workflows/ y dentro un archivo llamado build.yaml.
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
name: Build and Push Frontend
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'index.html'
|
||||||
|
- 'Dockerfile'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout del código
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Login en Gitea Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: gitea.cruzcloud.net
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Construir y Subir Imagen
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
# Usamos el SHA del commit para generar tags únicos automáticamente
|
||||||
|
tags: |
|
||||||
|
gitea.cruzcloud.net/devops/ecommerce-frontend:${{ gitea.sha }}
|
||||||
|
gitea.cruzcloud.net/devops/ecommerce-frontend:latest
|
||||||
Reference in New Issue
Block a user