Skip to content

Commit 0432fd9

Browse files
committed
feat(ci): integrar pipeline multilingüe centralizado y triggers de plantillas
- Actualiza el workflow de despliegue continuo (.github/workflows/deploy.yml) para procesar eventos repository_dispatch con el tipo update-projects. - Configura la clonación y doble build (ES/EN) de las tres plantillas dentro de los subdirectorios de dist/ usando las variables BASE_PATH y PUBLIC_LOCALE. - Sincroniza package.json y CHANGELOG.md a la versión v0.23.0 documentando la arquitectura de despliegue centralizada. Técnico: La compilación unificada genera las salidas en /plantilla-*/ y /en/template-*/ dentro de dist/ antes de la publicación a GitHub Pages.
1 parent e9559aa commit 0432fd9

7 files changed

Lines changed: 171 additions & 31 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Deploy to GitHub Pages
33
on:
44
push:
55
branches: [ main ]
6+
workflow_dispatch:
7+
repository_dispatch:
8+
types: [ update-projects ]
69

710
permissions:
811
contents: read
@@ -18,7 +21,7 @@ jobs:
1821
name: Build
1922
runs-on: ubuntu-latest
2023
steps:
21-
- name: Checkout
24+
- name: Checkout main repository
2225
uses: actions/checkout@v4
2326

2427
- name: Install Puppeteer system dependencies
@@ -31,11 +34,64 @@ jobs:
3134
with:
3235
bun-version: latest
3336

34-
- name: Install dependencies
35-
run: bun install --frozen-lockfile
37+
- name: Install dependencies & Build ctgcode.com
38+
run: |
39+
bun install --frozen-lockfile
40+
bun run build
41+
42+
- name: Checkout plantilla-negocio-local
43+
uses: actions/checkout@v4
44+
with:
45+
repository: ctgcode-com/plantilla-negocio-local
46+
path: templates/plantilla-negocio-local
47+
token: ${{ secrets.PORTFOLIO_TRIGGER_TOKEN || github.token }}
3648

37-
- name: Build Astro
38-
run: bun run build
49+
- name: Build plantilla-negocio-local (ES & EN)
50+
run: |
51+
mkdir -p dist/en
52+
cd templates/plantilla-negocio-local
53+
bun install
54+
BASE_PATH="/plantilla-negocio-local" PUBLIC_LOCALE="es" bun run build
55+
cp -r dist ../../dist/plantilla-negocio-local
56+
BASE_PATH="/en/template-local-business" PUBLIC_LOCALE="en" bun run build
57+
cp -r dist ../../dist/en/template-local-business
58+
cd ../..
59+
60+
- name: Checkout plantilla-servicios-profesionales
61+
uses: actions/checkout@v4
62+
with:
63+
repository: ctgcode-com/plantilla-servicios-profesionales
64+
path: templates/plantilla-servicios-profesionales
65+
token: ${{ secrets.PORTFOLIO_TRIGGER_TOKEN || github.token }}
66+
67+
- name: Build plantilla-servicios-profesionales (ES & EN)
68+
run: |
69+
mkdir -p dist/en
70+
cd templates/plantilla-servicios-profesionales
71+
bun install
72+
BASE_PATH="/plantilla-servicios-profesionales" PUBLIC_LOCALE="es" bun run build
73+
cp -r dist ../../dist/plantilla-servicios-profesionales
74+
BASE_PATH="/en/template-professional-services" PUBLIC_LOCALE="en" bun run build
75+
cp -r dist ../../dist/en/template-professional-services
76+
cd ../..
77+
78+
- name: Checkout plantilla-producto-startup
79+
uses: actions/checkout@v4
80+
with:
81+
repository: ctgcode-com/plantilla-producto-startup
82+
path: templates/plantilla-producto-startup
83+
token: ${{ secrets.PORTFOLIO_TRIGGER_TOKEN || github.token }}
84+
85+
- name: Build plantilla-producto-startup (ES & EN)
86+
run: |
87+
mkdir -p dist/en
88+
cd templates/plantilla-producto-startup
89+
bun install
90+
BASE_PATH="/plantilla-producto-startup" PUBLIC_LOCALE="es" bun run build
91+
cp -r dist ../../dist/plantilla-producto-startup
92+
BASE_PATH="/en/template-startup-product" PUBLIC_LOCALE="en" bun run build
93+
cp -r dist ../../dist/en/template-startup-product
94+
cd ../..
3995
4096
- name: Upload artifact
4197
uses: actions/upload-pages-artifact@v3

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,3 +423,15 @@ Todos los cambios notables en este proyecto serán documentados en este archivo
423423
- Las capturas de plantilla miden `1905×770` (alguna `771`): el marco fija la relación `1905/770` y recorta con `overflow`, así el píxel de más queda fuera. La de Recogras es una página larga (`1905×7368`), que se recorta a su primer pliegue con `aspect-ratio` + máscara de fundido: se lee «esto sigue» en vez de mostrar la página entera.
424424
- Un `grid-column` sin acotar (`.bt-head--right` del bloque de Helio) se filtraba a la cabecera de automatizaciones y le rompía la rejilla en 12 columnas fantasma; las colocaciones de rejilla quedan **acotadas a su sección**.
425425
- La página se compone con el patrón del sistema (ruta delgada → componente en `components/pages/Projects/` → hoja co-ubicada); textos en los locales bajo `LocaleSchema`; ninguna escena de `backdrop/` del descenso salvo `Starfield` en la portada.
426+
427+
## [0.23.0] - 2026-07-22
428+
429+
### Añadido
430+
431+
- **Pipeline de despliegue centralizado multilingüe** (`.github/workflows/deploy.yml`): automatización en GitHub Actions para compilar la aplicación principal `ctgcode.com` y realizar la clonación y doble compilación (Español e Inglés) de las tres plantillas independientes (`plantilla-negocio-local`, `plantilla-servicios-profesionales`, `plantilla-producto-startup`).
432+
- Soporte para el evento `repository_dispatch` (`update-projects`) que permite disparar el despliegue automático desde los repositorios individuales de cada plantilla.
433+
434+
### Técnico
435+
436+
- Integración de variables de entorno `BASE_PATH` y `PUBLIC_LOCALE` para generar las salidas estáticas en subdirectorios coordinados (`/plantilla-*/` y `/en/template-*/`) compilados directamente a la carpeta `dist/` para GitHub Pages.
437+

astro.config.mjs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,66 @@ export default defineConfig({
1414
en: "en",
1515
},
1616
},
17+
customPages: [
18+
"https://ctgcode.com/plantilla-negocio-local/",
19+
"https://ctgcode.com/en/template-local-business/",
20+
"https://ctgcode.com/plantilla-servicios-profesionales/",
21+
"https://ctgcode.com/en/template-professional-services/",
22+
"https://ctgcode.com/plantilla-producto-startup/",
23+
"https://ctgcode.com/en/template-startup-product/",
24+
],
25+
serialize(item) {
26+
// Asignar hreflang cruzado para la plantilla de negocio local
27+
if (
28+
item.url === "https://ctgcode.com/plantilla-negocio-local/" ||
29+
item.url === "https://ctgcode.com/en/template-local-business/"
30+
) {
31+
item.links = [
32+
{ url: "https://ctgcode.com/plantilla-negocio-local/", lang: "es" },
33+
{
34+
url: "https://ctgcode.com/en/template-local-business/",
35+
lang: "en",
36+
},
37+
];
38+
}
39+
40+
// Asignar hreflang cruzado para la plantilla de servicios profesionales
41+
if (
42+
item.url ===
43+
"https://ctgcode.com/plantilla-servicios-profesionales/" ||
44+
item.url === "https://ctgcode.com/en/template-professional-services/"
45+
) {
46+
item.links = [
47+
{
48+
url: "https://ctgcode.com/plantilla-servicios-profesionales/",
49+
lang: "es",
50+
},
51+
{
52+
url: "https://ctgcode.com/en/template-professional-services/",
53+
lang: "en",
54+
},
55+
];
56+
}
57+
58+
// Asignar hreflang cruzado para la plantilla de producto startup
59+
if (
60+
item.url === "https://ctgcode.com/plantilla-producto-startup/" ||
61+
item.url === "https://ctgcode.com/en/template-startup-product/"
62+
) {
63+
item.links = [
64+
{
65+
url: "https://ctgcode.com/plantilla-producto-startup/",
66+
lang: "es",
67+
},
68+
{
69+
url: "https://ctgcode.com/en/template-startup-product/",
70+
lang: "en",
71+
},
72+
];
73+
}
74+
75+
return item;
76+
},
1777
}),
1878
],
1979
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ctg-code",
3-
"version": "0.22.0",
3+
"version": "0.23.0",
44
"dependencies": {
55
"@astrojs/sitemap": "^3.7.3",
66
"@fontsource-variable/inter": "^5.2.8",

src/components/pages/Projects/Projects.astro

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -487,18 +487,35 @@ const [idShipped, idHelio, idTemplates, idAutomations] = ids;
487487
>
488488
{shot ? (
489489
<figure class="bt-frame bt-frame--shot">
490-
<picture>
491-
<source srcset={shot.avif.src} type="image/avif" />
492-
<source srcset={shot.webp.src} type="image/webp" />
493-
<img
494-
src={shot.png.src}
495-
width={shot.png.width}
496-
height={shot.png.height}
497-
alt={item.name}
498-
loading="lazy"
499-
decoding="async"
500-
/>
501-
</picture>
490+
{item.demoUrl ? (
491+
<a href={item.demoUrl} tabindex="-1" aria-hidden="true">
492+
<picture>
493+
<source srcset={shot.avif.src} type="image/avif" />
494+
<source srcset={shot.webp.src} type="image/webp" />
495+
<img
496+
src={shot.png.src}
497+
width={shot.png.width}
498+
height={shot.png.height}
499+
alt={item.name}
500+
loading="lazy"
501+
decoding="async"
502+
/>
503+
</picture>
504+
</a>
505+
) : (
506+
<picture>
507+
<source srcset={shot.avif.src} type="image/avif" />
508+
<source srcset={shot.webp.src} type="image/webp" />
509+
<img
510+
src={shot.png.src}
511+
width={shot.png.width}
512+
height={shot.png.height}
513+
alt={item.name}
514+
loading="lazy"
515+
decoding="async"
516+
/>
517+
</picture>
518+
)}
502519
</figure>
503520
) : (
504521
<div class="bt-frame" aria-hidden="true">
@@ -522,12 +539,7 @@ const [idShipped, idHelio, idTemplates, idAutomations] = ids;
522539
</ul>
523540

524541
{item.demoUrl ? (
525-
<a
526-
class="bt-demo"
527-
href={item.demoUrl}
528-
target="_blank"
529-
rel="noopener noreferrer"
530-
>
542+
<a class="bt-demo" href={item.demoUrl}>
531543
{L.demo}
532544
<span class="bt-demo-arrow" aria-hidden="true">
533545
@@ -765,4 +777,4 @@ const [idShipped, idHelio, idTemplates, idAutomations] = ids;
765777
applyFlow();
766778
reduceMotion.addEventListener("change", applyFlow);
767779
}
768-
</script>
780+
</script>

src/data/locales/en.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ const en: LocaleSchema = {
190190
'Financial advisors',
191191
'Architects',
192192
],
193-
demoUrl: '',
193+
demoUrl: '/en/template-professional-services',
194194
},
195195
{
196196
slug: 'local-business',
@@ -204,7 +204,7 @@ const en: LocaleSchema = {
204204
'Shops',
205205
'Gyms',
206206
],
207-
demoUrl: '',
207+
demoUrl: '/en/template-local-business',
208208
},
209209
{
210210
slug: 'startups-products',
@@ -217,7 +217,7 @@ const en: LocaleSchema = {
217217
'Launches',
218218
'Digital products',
219219
],
220-
demoUrl: '',
220+
demoUrl: '/en/template-startup-product',
221221
},
222222
],
223223
},

src/data/locales/es.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ const es: LocaleSchema = {
190190
'Asesores financieros',
191191
'Arquitectos',
192192
],
193-
demoUrl: '',
193+
demoUrl: '/plantilla-servicios-profesionales',
194194
},
195195
{
196196
slug: 'negocios-locales',
@@ -204,7 +204,7 @@ const es: LocaleSchema = {
204204
'Tiendas',
205205
'Gimnasios',
206206
],
207-
demoUrl: '',
207+
demoUrl: '/plantilla-negocio-local',
208208
},
209209
{
210210
slug: 'startups-productos',
@@ -217,7 +217,7 @@ const es: LocaleSchema = {
217217
'Lanzamientos',
218218
'Productos digitales',
219219
],
220-
demoUrl: '',
220+
demoUrl: '/plantilla-producto-startup',
221221
},
222222
],
223223
},

0 commit comments

Comments
 (0)