Merge pull request 'docs' (#7) from dev into master

Reviewed-on: #7
This commit is contained in:
2025-09-01 16:48:33 +02:00

View File

@@ -3,10 +3,8 @@ run-name: Deploying ${{ gitea.repository }} docs locally
on:
push:
branches:
- main
paths:
- "docs/**"
branches: [main]
paths: ["docs/**", "mkdocs.yml", ".gitea/workflows/deploy-docs.yaml"]
jobs:
deploy-docs:
@@ -26,14 +24,14 @@ jobs:
- name: Build documentation
run: |
cd docs
ls
mkdocs build --site-dir ../build
- name: Deploy to IIS directory
shell: powershell
run: |
$projectName = "${{ gitea.repository_name }}"
$basePath = "${{ secrets.DEPLOY_BASE_PATH }}"
$projectName = "${{ vars.GIT_REPOSITORY }}"
$basePath = Join-Path "${{ secrets.DEPLOY_BASE_PATH }}"
$targetPath = Join-Path $basePath $projectName
# Crear directorio del proyecto si no existe
@@ -43,7 +41,7 @@ jobs:
New-Item -ItemType Directory -Path $targetPath -Force
# Copiar archivos construidos
Copy-Item -Path "build\*" -Destination $targetPath -Recurse -Force
Copy-Item -Path "..\build\*" -Destination $targetPath -Recurse -Force
Write-Host "Documentation deployed to: $targetPath"
@@ -51,10 +49,11 @@ jobs:
shell: powershell
run: |
$docsPath = "${{ secrets.DEPLOY_BASE_PATH }}"
$docsPath = Join-Path $docsPath
$indexPath = Join-Path $docsPath "index.html"
# Obtener todos los directorios de documentación
$docFolders = Get-ChildItem -Path $docsPath -Directory | Where-Object { $_.Name -notin @("dev", "test") } | Sort-Object Name
$docFolders = Get-ChildItem -Path $docsPath -Directory | Sort-Object Name
# Generar HTML del índice
$htmlContent = @"
@@ -63,7 +62,7 @@ jobs:
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documentación - MCV Ingenieros</title>
<title>Documentacion - MCV Ingenieros</title>
<style>
* {
margin: 0;
@@ -177,8 +176,8 @@ jobs:
<body>
<div class="container">
<div class="header">
<h1>📚 Centro de Documentación</h1>
<p>MCV Ingenieros - Documentación de Proyectos</p>
<h1>Centro de Documentacion</h1>
<p>MCV Ingenieros - Documentacion de Proyectos</p>
</div>
<div class="projects">
@@ -191,10 +190,8 @@ jobs:
$htmlContent += @"
<div class="project-card">
<a href="./$folderName/" class="project-link">
<span class="project-icon">📖</span>
<h3 class="project-title">$folderName</h3>
<div class="project-meta">
<span>🕒</span>
<span>Actualizado: $lastWrite</span>
</div>
</a>
@@ -207,7 +204,7 @@ jobs:
</div>
<div class="footer">
<p>Índice generado automáticamente el $currentDate</p>
<p>Indice generado automaticamente el $currentDate</p>
<p>Powered by Gitea Actions & IIS</p>
</div>
</div>