up #349
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |