From 22c5b5e50284af41b459c801206bd422584a2ff7 Mon Sep 17 00:00:00 2001 From: Kristina Date: Sun, 17 May 2026 23:45:03 +0200 Subject: [PATCH] primero tag 8 --- .gitea/workflows/ci.yaml | 79 +++++++++++++--------------------------- 1 file changed, 26 insertions(+), 53 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index e74cef7..1ff60cd 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -1,59 +1,33 @@ -name: Deploy HTML + release +name: Build and Release on: push: - branches: [main] + tags: + - 'v*' jobs: - deploy: - runs-on: ubuntu-22.04 - container: - image: catthehacker/ubuntu:act-22.04 - volumes: - - /srv/devops/data/apache/htdocs:/output - + build-and-release: + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Convertir y desplegar - shell: bash + - name: Ejecutar build run: | - chmod +x convertir.sh - ./convertir.sh - - # Opcional: copiar a release-dir lo que vaya a ir como asset - rm -rf release-dir mkdir -p release-dir - cp /output/*.html release-dir/ || true - - - name: Obtener Ășltima tag - run: | - set +e - TAG=$(git describe --tags --abbrev=0 2>/dev/null) - STATUS=$? - set -e - - if [ $STATUS -ne 0 ] || [ -z "$TAG" ]; then - echo "No hay tags en el repositorio, no creo release" - exit 0 # o exit 1 si quieres fallar el job - fi - - echo "Ultima tag encontrada: $TAG" - echo "TAG=$TAG" >> "$GITHUB_ENV" + echo "# Documento convertido" > release-dir/documento.md + echo "" >> release-dir/documento.md + cat archivo.txt >> release-dir/documento.md + echo "Release $(date +%Y-%m-%d)" > release-dir/version.txt + echo "Build completado" + ls -lh release-dir/ - name: Crear release env: TOKEN: ${{ secrets.RELEASE_TOKEN }} - FORGEJO_API: ${{ github.api_url }} - REPO: ${{ github.repository }} - TAG: ${{ env.TAG }} run: | - if [ -z "$TAG" ]; then - echo "No hay TAG definida, no creo release" - exit 1 - fi - + TAG="${GITHUB_REF_NAME}" + JSON_PAYLOAD=$(cat <