-
Notifications
You must be signed in to change notification settings - Fork 0
212 lines (176 loc) · 6.8 KB
/
gh-page.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: GitHub Pages
on:
push:
branches:
- main # La rama principal desde la que se hará el push
pull_request:
jobs:
deploy_isp_uv:
runs-on: ubuntu-22.04
steps:
# Paso 1: Checkout del repositorio
- uses: actions/checkout@v4
with:
submodules: true # Descargar submódulos (temas de Hugo)
fetch-depth: 0 # Descargar todo el historial
# Paso 2: Configuración de Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.125.7'
# extended: true # Habilita esto si necesitas soporte SCSS/SASS
# Paso 3: Construcción del sitio
- name: Build Hugo site
run: hugo --minify --config hugo-alt.toml
# Paso 4: Despliegue en GitHub Pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
publish_branch: gh-pages
deploy_github:
needs: deploy_isp_uv
runs-on: ubuntu-22.04
steps:
# Paso 1: Checkout del repositorio
- uses: actions/checkout@v4
with:
submodules: true # Descargar submódulos (temas de Hugo)
fetch-depth: 0 # Descargar todo el historial
# Paso 2: Configuración de Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.125.7'
# extended: true # Habilita esto si necesitas soporte SCSS/SASS
# Paso 3: Construcción del sitio
- name: Build Hugo site
run: hugo --minify --config hugo.toml
# Paso 4: Despliegue en GitHub Pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-ipl-pages # La rama de publicación en GitHub Pages
deploy_prometeo_isp:
needs: deploy_isp_uv
runs-on: ubuntu-22.04
steps:
# Paso 1: Checkout del repositorio
- uses: actions/checkout@v4
with:
submodules: true # Descargar submódulos (temas de Hugo)
fetch-depth: 0 # Descargar todo el historial
# Paso 2: Configuración de Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.125.7'
# extended: true # Habilita esto si necesitas soporte SCSS/SASS
# Paso 3: Construcción del sitio
- name: Build Hugo site
run: hugo --minify --config hugo-alt_prometeo.toml
# Paso 4: Despliegue en GitHub Pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-prometeo_isp # La rama de publicación en GitHub Pages
deploy_prometeo_ipl:
needs: deploy_github
runs-on: ubuntu-22.04
steps:
# Paso 1: Checkout del repositorio
- uses: actions/checkout@v4
with:
submodules: true # Descargar submódulos (temas de Hugo)
fetch-depth: 0 # Descargar todo el historial
# Paso 2: Configuración de Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.125.7'
# extended: true # Habilita esto si necesitas soporte SCSS/SASS
# Paso 3: Construcción del sitio
- name: Build Hugo site
run: hugo --minify --config hugo_prometeo.toml
# Paso 4: Despliegue en GitHub Pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: gh-prometeo_ipl # La rama de publicación en GitHub Pages
copy_isp_uv:
name: Copy content from source branch to target folder
runs-on: ubuntu-latest
needs: deploy_prometeo_isp
steps:
- uses: actions/checkout@v2
- name: Copy files to target branch
env:
SOURCE_BRANCH: 'gh-prometeo_isp'
TARGET_BRANCH: 'gh-pages'
TARGET_FOLDER: 'projects/prometeo'
run: |
# Configurar git
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
# Check out la rama fuente
git fetch origin $SOURCE_BRANCH
git checkout $SOURCE_BRANCH
# Crear un directorio temporal para copiar los archivos
TMP_DIR=$(mktemp -d)
cp -R ./* $TMP_DIR/
# Check out la rama destino
git fetch origin $TARGET_BRANCH
git checkout $TARGET_BRANCH
# Crear la carpeta de destino si no existe
mkdir -p $TARGET_FOLDER
# Limpiar la carpeta de destino (opcional: solo si quieres sobrescribir todo)
rm -rf $TARGET_FOLDER/*
# Copiar los archivos desde el directorio temporal a la carpeta de destino
cp -R $TMP_DIR/* $TARGET_FOLDER/
# Añadir y confirmar cambios si los hay
git add -A
git diff-index --quiet HEAD || git commit -m "Sync files from $SOURCE_BRANCH to $TARGET_FOLDER"
# Push los cambios a la rama destino
git push origin $TARGET_BRANCH
copy_github:
name: Copy content from source branch to target folder
runs-on: ubuntu-latest
needs: deploy_prometeo_ipl
steps:
- uses: actions/checkout@v2
- name: Copy files to target branch
env:
SOURCE_BRANCH: 'gh-prometeo_ipl'
TARGET_BRANCH: 'gh-ipl-pages'
TARGET_FOLDER: 'projects/prometeo'
run: |
# Configurar git
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
# Check out la rama fuente
git fetch origin $SOURCE_BRANCH
git checkout $SOURCE_BRANCH
# Crear un directorio temporal para copiar los archivos
TMP_DIR=$(mktemp -d)
cp -R ./* $TMP_DIR/
# Check out la rama destino
git fetch origin $TARGET_BRANCH
git checkout $TARGET_BRANCH
# Crear la carpeta de destino si no existe
mkdir -p $TARGET_FOLDER
# Limpiar la carpeta de destino (opcional: solo si quieres sobrescribir todo)
rm -rf $TARGET_FOLDER/*
# Copiar los archivos desde el directorio temporal a la carpeta de destino
cp -R $TMP_DIR/* $TARGET_FOLDER/
# Añadir y confirmar cambios si los hay
git add -A
git diff-index --quiet HEAD || git commit -m "Sync files from $SOURCE_BRANCH to $TARGET_FOLDER"
# Push los cambios a la rama destino
git push origin $TARGET_BRANCH