Skip to content

Commit 1413132

Browse files
pixelead0pixelead0
andauthored
Se agregan validaciones de archivos en los workflows (#13)
* fix conflicts * Restaurar configuración personalizada de Docker y repositorio * Recuperar configuración de workflows y herramientas de desarrollo - Agregar build.yml y ci-cd.yml workflows - Actualizar deploy.yml workflow - Configurar pre-commit hooks - Agregar requirements-dev.txt - Mejorar scripts de check_links y generate_meetups - Actualizar configuración markdownlint * Update GitHub Actions workflows to use version 4 of upload and download artifact actions * chore: apply linter auto-fixes * fix: corregir ruta del script check_links.py en workflow - Usar ${{ github.workspace }} para garantizar directorio correcto - Mejorar gestión de directorios en paso de broken links - Agregar comentarios para mayor claridad Esto resuelve el error 'No such file or directory' del script. --------- Co-authored-by: pixelead0 <[email protected]>
1 parent 7c517de commit 1413132

31 files changed

+372
-234
lines changed

.github/workflows/build.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build and Validate
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-validate:
11+
name: Build and Validate Documentation
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.10'
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
29+
- name: Run pre-commit checks
30+
uses: pre-commit/[email protected]
31+
32+
- name: Build with MkDocs
33+
run: mkdocs build
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Check for broken links
38+
run: |
39+
# Iniciar servidor HTTP en background
40+
cd site && python -m http.server 8000 &
41+
sleep 10
42+
43+
# Ejecutar check de links desde el directorio raíz
44+
cd ${{ github.workspace }}
45+
python scripts/check_links.py
46+
47+
# Verificar resultado
48+
broken_count=$(jq '.summary.broken_links' broken_links.json)
49+
50+
if [ "$broken_count" -gt 0 ]; then
51+
echo "❌ Found $broken_count broken links - failing!"
52+
pkill -f "python -m http.server" || true
53+
exit 1
54+
fi
55+
56+
echo "✅ All links working!"
57+
pkill -f "python -m http.server" || true
58+
59+
# Solo para main: guardar el sitio construido
60+
- name: Upload build artifact
61+
if: github.ref == 'refs/heads/main'
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: site
65+
path: site/
66+
retention-days: 1

.github/workflows/ci-cd.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
jobs:
15+
build-and-validate:
16+
name: Build and Validate
17+
runs-on: ubuntu-latest
18+
steps:
19+
# ... todos los pasos de validación y build ...
20+
21+
deploy:
22+
name: Deploy to GitHub Pages
23+
if: github.ref == 'refs/heads/main'
24+
needs: build-and-validate
25+
runs-on: ubuntu-latest
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
29+
steps:
30+
# ... pasos de deploy ...

.github/workflows/deploy.yml

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: Deploy to GitHub Pages
22

33
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
4+
workflow_run:
5+
workflows: ["Build and Validate"]
6+
types:
7+
- completed
78
branches: [ main ]
89

910
permissions:
@@ -16,45 +17,30 @@ concurrency:
1617
cancel-in-progress: false
1718

1819
jobs:
19-
build:
20+
deploy:
21+
name: Deploy to GitHub Pages
22+
if: github.event.workflow_run.conclusion == 'success'
2023
runs-on: ubuntu-latest
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deployment.outputs.page_url }}
2127
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v4
24-
with:
25-
fetch-depth: 0
26-
27-
- name: Set up Python
28-
uses: actions/setup-python@v4
28+
- name: Download build artifact
29+
uses: actions/download-artifact@v4
2930
with:
30-
python-version: '3.10'
31-
32-
- name: Install dependencies
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install -r requirements.txt
36-
37-
- name: Build with MkDocs
38-
run: mkdocs build
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
name: site
32+
path: site/
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
run-id: ${{ github.event.workflow_run.id }}
4135

4236
- name: Setup Pages
4337
uses: actions/configure-pages@v4
4438

45-
- name: Upload artifact
46-
uses: actions/upload-pages-artifact@v3
39+
- name: Upload to GitHub Pages
40+
uses: actions/upload-pages-artifact@v4
4741
with:
48-
path: './site'
42+
path: site/
4943

50-
deploy:
51-
environment:
52-
name: github-pages
53-
url: ${{ steps.deployment.outputs.page_url }}
54-
runs-on: ubuntu-latest
55-
needs: build
56-
if: github.ref == 'refs/heads/main'
57-
steps:
5844
- name: Deploy to GitHub Pages
5945
id: deployment
6046
uses: actions/deploy-pages@v4

.markdownlint.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
{
2+
"MD001": true,
3+
"MD003": { "style": "atx" },
4+
"MD004": { "style": "dash" },
5+
"MD007": { "indent": 2 },
6+
"MD010": { "spaces_per_tab": 2 },
7+
"MD012": false,
8+
"MD013": { "line_length": 120 },
9+
"MD022": false,
10+
"MD025": true,
11+
"MD026": { "punctuation": ".,;:!?" },
12+
"MD029": { "style": "ordered" },
13+
"MD030": { "ul_single": 1, "ul_multi": 1, "ol_single": 1, "ol_multi": 1 },
14+
"MD031": false,
15+
"MD032": false,
216
"MD033": false,
17+
"MD034": false,
18+
"MD036": false,
319
"MD041": false,
4-
"MD013": false,
5-
"MD025": false,
6-
"MD026": false
20+
"MD051": false
721
}

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
repos:
2+
# Hooks básicos
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.5.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
exclude: ^mkdocs\.yml$ # Excluir mkdocs.yml
10+
- id: check-json
11+
- id: check-added-large-files
12+
- id: check-merge-conflict
13+
# - id: requirements-txt-fixer # Comentado si no lo quieres
14+
15+
# Validación de Markdown - MENOS ESTRICTO para empezar
16+
- repo: https://github.com/igorshubovych/markdownlint-cli
17+
rev: v0.39.0
18+
hooks:
19+
- id: markdownlint
20+
args: ['--config', '.markdownlint.json', '--disable', 'MD012', 'MD022', 'MD032']
21+
files: ^docs/.*\.md$
22+
23+
# Formateo de Python (opcional, pero útil para scripts)
24+
- repo: https://github.com/psf/black
25+
rev: 23.12.1
26+
hooks:
27+
- id: black
28+
files: ^scripts/.*\.py$

broken_links.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,4 +719,4 @@
719719
"link_type": "html"
720720
}
721721
]
722-
}
722+
}

docs/comunidad/alianzas.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,3 @@ Python CDMX trabaja en colaboración con diversas comunidades y empresas para cr
203203
--8<-- "components/quick-navigation.md"
204204

205205
---
206-

docs/meetups/2023/202309-septiembre.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ title: "Utilizando Servicios AI de AWS y Metaprogramación en Python"
5353
<p>SRE Engineer</p>
5454
<p>SRE Engineer en Wizeline con experiencia en servicios cloud de AWS y desarrollo Python.</p>
5555
<div class="speaker-links">
56-
56+
5757

5858

5959
</div>

docs/meetups/2023/202310-octubre.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ title: "¡De Jupyter a Web en Minutos!"
4747
<p class="speaker-role">Python Developer</p>
4848
<p class="speaker-bio">Desarrollador Python con experiencia en análisis de datos y desarrollo web.</p>
4949
<div class="speaker-links">
50-
51-
52-
50+
51+
52+
5353
</div>
5454
</div>
5555
</div>
@@ -63,7 +63,7 @@ title: "¡De Jupyter a Web en Minutos!"
6363
<p>¿Tienes esa gran idea, pero no sabes cómo organizar tu ambiente virtual, tu código y todas las herramientas de desarrollo?</p>
6464
<p>En esta charla exploraremos las mejores prácticas para configurar un entorno de desarrollo Python profesional:</p>
6565
<ul>
66-
66+
6767
</ul>
6868
<p>
6969
<i class="fas fa-info-circle"></i> Python permite transformar análisis de datos locales en servicios web interactivos de manera rápida y eficiente.

docs/meetups/2023/202311-noviembre.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,34 +53,34 @@ title: "GitOps 101 / Python: La Forja de un Lenguaje"
5353
<p>DevOps Engineer</p>
5454
<p>Especialista en GitOps y Kubernetes con experiencia en despliegue de aplicaciones cloud native.</p>
5555
<div class="speaker-links">
56-
57-
58-
56+
57+
58+
5959
</div>
6060
</div>
6161
</div>
6262
<div class="talk-description">
6363
<p>En esta charla se mostrará los conceptos de GitOps y Cloud Native que nos permitirán conocer las estrategias de despliegue en Kubernetes.</p>
64-
64+
6565
<div class="tech-stack">
66-
66+
6767
<div>
6868
<h5>🔄 GitOps</h5>
6969
<p>Metodología de despliegue</p>
7070
</div>
71-
71+
7272
<div>
7373
<h5>☸️ Kubernetes</h5>
7474
<p>Orquestación de contenedores</p>
7575
</div>
76-
76+
7777
<div>
7878
<h5>☁️ Cloud Native</h5>
7979
<p>Aplicaciones nativas en la nube</p>
8080
</div>
81-
81+
8282
</div>
83-
83+
8484
<p>GitOps proporciona una metodología robusta para el despliegue y gestión de aplicaciones en Kubernetes.</p>
8585
</div>
8686
</div>
@@ -99,34 +99,34 @@ title: "GitOps 101 / Python: La Forja de un Lenguaje"
9999
<p>Python Developer</p>
100100
<p>Desarrollador Python con experiencia en compiladores y construcción de lenguajes de programación.</p>
101101
<div class="speaker-links">
102-
103-
104-
102+
103+
104+
105105
</div>
106106
</div>
107107
</div>
108108
<div class="talk-description">
109109
<p>Explora la construcción de un lenguaje con Python, desde los pilares teóricos hasta un sorprendente guiño a la sintaxis financiera.</p>
110-
110+
111111
<div class="tech-stack">
112-
112+
113113
<div>
114114
<h5>⚙️ Compilers</h5>
115115
<p>Compiladores</p>
116116
</div>
117-
117+
118118
<div>
119119
<h5>🔧 Language Design</h5>
120120
<p>Diseño de lenguajes</p>
121121
</div>
122-
122+
123123
<div>
124124
<h5>📝 Parsing</h5>
125125
<p>Análisis sintáctico</p>
126126
</div>
127-
127+
128128
</div>
129-
129+
130130
<p>Construir un lenguaje de programación es una excelente manera de entender los fundamentos de la computación.</p>
131131
</div>
132132
</div>

0 commit comments

Comments
 (0)