diff --git a/workloads/ecommerce/build.yaml b/workloads/ecommerce/build.yaml new file mode 100644 index 0000000..6e19fb6 --- /dev/null +++ b/workloads/ecommerce/build.yaml @@ -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 \ No newline at end of file