Compare commits

...

26 commits
v2.0.8 ... main

Author SHA1 Message Date
Kristina
3086cc7523 repo comprimido 2
All checks were successful
Build tar/zip y Release por version / build-and-release (push) Successful in 16s
2026-05-18 00:02:14 +02:00
Kristina
b8b6e87a89 repo comprimido
All checks were successful
Tar y Zip por version / archive (push) Successful in 5s
2026-05-17 23:51:46 +02:00
Kristina
22c5b5e502 primero tag 8
All checks were successful
Build and Release / build-and-release (push) Successful in 6s
2026-05-17 23:45:03 +02:00
Kristina
6a7d65b187 primero tag 7
Some checks failed
Deploy HTML + release / deploy (push) Failing after 21s
2026-05-17 23:35:34 +02:00
Kristina
0cc2fa76fe primero tag 6
Some checks failed
Deploy HTML + release / deploy (push) Failing after 20s
2026-05-17 21:56:31 +02:00
Kristina
b1c531861e primero tag 5
Some checks failed
Deploy HTML + release / deploy (push) Failing after 21s
2026-05-17 21:53:31 +02:00
Kristina
9bf5071842 primero tag 4 2026-05-17 21:49:31 +02:00
Kristina
2823a6b8f7 primero tag 2 2026-05-17 21:48:11 +02:00
Kristina
8000a94687 primero tag 1 2026-05-17 21:46:28 +02:00
Kristina
6f1c2d6037 primero tag 2026-05-17 21:45:47 +02:00
Kristina
fe9cf12d4f release + html 6 2026-05-17 21:44:49 +02:00
Kristina
3171fa1363 release + html 5 2026-05-17 21:43:31 +02:00
Kristina
9d3fdbccb2 release + html 4 2026-05-17 21:42:58 +02:00
Kristina
0110ab2633 release + html 3 2026-05-17 21:41:58 +02:00
Kristina
379f817e1e release + html 2 2026-05-17 21:40:53 +02:00
Kristina
36c2a5a228 despues etiqueta
Some checks failed
Deploy HTML + release / deploy (push) Failing after 24s
2026-05-17 21:32:22 +02:00
Kristina
f517ef1eed primero etiqueta
Some checks failed
Deploy HTML + release / deploy (push) Failing after 22s
2026-05-17 21:29:55 +02:00
Kristina
70d19fd022 convertir bueno
Some checks failed
Deploy HTML + release / deploy (push) Failing after 26s
2026-05-17 21:26:08 +02:00
Kristina
a85b6b6e90 html + release
All checks were successful
Deploy HTML + release / deploy (push) Successful in 22s
2026-05-17 21:22:22 +02:00
Kristina
c92b575bf4 prueba release + html 2
Some checks failed
Deploy HTML + release / deploy (push) Failing after 12s
2026-05-17 21:19:43 +02:00
Kristina
dec62a9e70 prueba release + html
Some checks failed
Deploy HTML + release / deploy (push) Failing after 9s
2026-05-17 21:12:33 +02:00
Kristina
f209927867 con token 4
All checks were successful
Build and Release / build-and-release (push) Successful in 7s
2026-05-16 17:39:54 +02:00
Kristina
7e1e41c789 con token 3 2026-05-16 17:37:37 +02:00
Kristina
43c152ac0b con caracteristica
All checks were successful
Build and Release / build-and-release (push) Successful in 8s
2026-05-16 17:32:40 +02:00
Kristina
b1d1465156 con token
All checks were successful
Build and Release / build-and-release (push) Successful in 6s
2026-05-16 17:05:42 +02:00
Kristina
eb71eb8d4d con token 2
All checks were successful
Build and Release / build-and-release (push) Successful in 7s
2026-05-16 17:02:49 +02:00
4 changed files with 166 additions and 35 deletions

View file

@ -1,52 +1,82 @@
name: Build and Release name: Build tar/zip y Release por version
on: on:
push: push:
tags: tags:
- 'v*' - 'v*' # Se ejecuta al pushear tags como v1.0.0, v0.1.0, etc.
jobs: jobs:
build-and-release: build-and-release:
runs-on: ubuntu-latest runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Ejecutar script de build - name: Preparar entorno
run: bash build.sh
- name: Crear release con los archivos generados
env:
RELEASE_TOKEN: ${{ secrets.release_token }}
run: | run: |
tag="${GITHUB_REF_NAME}" apt-get update
apt-get install -y jq
# Crear el release - name: Crear tar y zip de la version
release_response=$(curl -s -X POST \ run: |
-H "Authorization: token $FORGEJO_TOKEN" \ mkdir -p release-dir
TAG="${GITHUB_REF_NAME}"
echo "Version/tag actual: $TAG"
# Empaquetar SOLO archivos versionados en esa tag
git archive --format=tar.gz --output="release-dir/repo-${TAG}.tar.gz" "$TAG"
git archive --format=zip --output="release-dir/repo-${TAG}.zip" "$TAG"
echo "Contenido de release-dir/"
ls -lh release-dir
- name: Crear release y subir assets
env:
TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
TAG="${GITHUB_REF_NAME}"
JSON_PAYLOAD=$(cat <<EOF
{
"tag_name": "${TAG}",
"name": "Release ${TAG}",
"body": "Release automatico a partir de la tag ${TAG}",
"draft": false,
"prerelease": false
}
EOF
)
echo "Creando release para tag: ${TAG}"
RESPONSE=$(curl -s -X POST \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases" \ -d "${JSON_PAYLOAD}" \
-d "{ "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases")
\"tag_name\": \"${tag}\",
\"name\": \"Release ${tag}\",
\"body\": \"Release automático generado por build.sh\",
\"draft\": false,
\"prerelease\": false
}")
echo "$release_response" echo "Respuesta: ${RESPONSE}"
release_id=$(echo "$release_response" | jq -r '.id')
echo "Release creado con ID: $release_id"
# Subir todos los archivos que generó el script RELEASE_ID=$(echo "${RESPONSE}" | jq -r '.id')
for file in release-dir/*; do
filename=$(basename "$file") if [ "${RELEASE_ID}" = "null" ] || [ -z "${RELEASE_ID}" ]; then
echo "Subiendo $filename al release..." echo "Error creando release"
curl -X POST \ exit 1
-H "Authorization: token $FORGEJO_TOKEN" \ fi
echo "Release creado con ID: ${RELEASE_ID}"
for FILE in release-dir/*; do
FILENAME=$(basename "${FILE}")
echo "Subiendo ${FILENAME}..."
curl -s -X POST \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/octet-stream" \ -H "Content-Type: application/octet-stream" \
--data-binary @"$file" \ --data-binary @"${FILE}" \
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${release_id}/assets?name=${filename}" "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${FILENAME}"
done done
echo "Release completado con todos los archivos" echo "Release completado correctamente"

22
archivo.md Normal file
View file

@ -0,0 +1,22 @@
hola, que tal
\- primer intento
\- segundo intento
\- tercer intento
\- con tag
\- después tag
\- con tag creado de antes
\- segunda prueba
\- tercera prueba
\- cuarta prueba

79
convertir.sh Normal file
View file

@ -0,0 +1,79 @@
#!/bin/bash
# =============================================================================
# convertir.sh — Convierte archivos Markdown a HTML y los publica en Apache
# Proyecto: JAK DevOps — workflow cy.yaml
#
# Requisitos:
# - Ejecutar dentro del job container con /output montado sobre el htdocs de Apache
# - El runner debe tener valid_volumes: ['/srv/devops/data/apache/**']
# =============================================================================
set -euo pipefail
OUTPUT_DIR="/output"
BASE_URL="https://portaljack.freeddns.org"
# -----------------------------------------------------------------------------
dependencies() {
echo "[1/3] Instalando dependencias..."
apt-get update -qq
apt-get install -y -qq pandoc
echo " pandoc $(pandoc --version | head -1 | cut -d' ' -f2) instalado"
}
# -----------------------------------------------------------------------------
convert_to_html() {
echo "[2/3] Convirtiendo Markdown → HTML..."
local converted=0
local errors=0
for md in *.md; do
# Guarda ante glob sin matches (bash con set -u no expande *.md si no hay ficheros)
[ -f "$md" ] || { echo " [WARN] No se encontraron archivos .md en el directorio de trabajo"; return 0; }
local filename="${md%.md}"
echo " Procesando: $md"
if pandoc "$md" \
--standalone \
--metadata title="$filename" \
--highlight-style=tango \
--output "${filename}.html"; then
converted=$((converted + 1))
else
echo " [ERROR] Fallo al convertir: $md"
errors=$((errors + 1))
fi
done
echo " Convertidos: ${converted} | Errores: ${errors}"
[ "$errors" -eq 0 ] || return 1
}
# -----------------------------------------------------------------------------
deploy() {
echo "[3/3] Publicando en Apache..."
local count=0
# Itera solo los HTML generados a partir de los .md presentes (no recoge HTMLs previos del repo)
for md in *.md; do
[ -f "$md" ] || continue
local html="${md%.md}.html"
[ -f "$html" ] || continue
cp "$html" "${OUTPUT_DIR}/"
count=$((count + 1))
echo ""
echo " ${BASE_URL}/${html}"
done
}
# -----------------------------------------------------------------------------
main() {
dependencies
convert_to_html
deploy
}
main

View file

@ -1 +1 @@
echo "holaaaaaa" echo "holaaaa"