diff --git a/.github/workflows/publicar-paquete.yml b/.github/workflows/publicar-paquete.yml new file mode 100644 index 0000000..f44f18c --- /dev/null +++ b/.github/workflows/publicar-paquete.yml @@ -0,0 +1,36 @@ +name: Generar Paquete Docker + +on: + # Permite ejecutarlo manualmente desde la pestaña "Acciones" + workflow_dispatch: + # Opcional: que se ejecute solo al crear una "Release" o etiqueta (tag) + push: + tags: + - 'v*' + +jobs: + build-and-push: + runs-on: ubuntu-latest # Esto coincidirá con el label de tu runner + steps: + - name: Checkout del código + uses: actions/checkout@v4 + + - name: Configurar Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login en Gitea Docker Registry + uses: docker/login-action@v3 + with: + registry: git.natxocc.com + username: ${{ gitea.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} # Gitea genera este token automáticamente + + - name: Construir y Subir imagen + uses: docker/build-push-action@v5 + with: + context: . + push: true + # El nombre será: git.natxocc.com/usuario/repositorio:latest + tags: | + git.natxocc.com/${{ gitea.repository }}:latest + git.natxocc.com/${{ gitea.repository }}:${{ gitea.ref_name }} \ No newline at end of file