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