Skip to content

Workflow file for this run

name: Copy Files to Blog Repository
on:
push:
branches:
- main # O la rama que desees monitorizar
jobs:
copy-files:
runs-on: ubuntu-latest
steps:
- name: Checkout Source Repository
uses: actions/checkout@v4 # Actualizamos a la última versión
- name: Checkout Destination Repository
uses: actions/checkout@v4
with:
repository: schmittnieto/schmittnieto.github.io
token: ${{ secrets.GH_PAT }}
# Clonamos el repositorio del blog en un directorio separado
path: blog_destination
- name: Copy Files
run: |
# Definir variables para las rutas
SOURCE_DIR="${{ github.workspace }}"
DEST_DIR="${{ github.workspace }}/blog_destination/assets/repo/AzSHCI"
# Crear el directorio de destino si no existe
mkdir -p "$DEST_DIR"
# Ejecutar rsync para copiar archivos del repositorio fuente al destino
rsync -av --exclude='.git' --exclude='blog_destination' "$SOURCE_DIR/" "$DEST_DIR/"
- name: Commit and Push Changes
working-directory: blog_destination
run: |
git config user.name "schmittnieto"
git config user.email "[email protected]"
git add .
git commit -m "Update files from AzSHCI repository"
git push origin main