Actualizar .github/workflows/deploy-docs.yaml

This commit is contained in:
2026-04-15 13:08:36 +02:00
parent 5d3ab87940
commit 26d33c94bf

View File

@@ -2,40 +2,34 @@ name: Deploy Docs to Synology
on: on:
push: push:
branches: branches: [main]
- main paths: ['docs/**']
paths:
- 'docs/**'
workflow_dispatch: workflow_dispatch:
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: # IMPORTANTE: Hemos eliminado la línea 'container:', ahora corre en el host del runner
image: node:20-bullseye
options: >-
--dns 192.168.1.1
--add-host git.natxocc.com:host-gateway
--add-host gitea:host-gateway
-v /volume1/web/sigpro:/target_folder
steps: steps:
- name: Instalar rsync
run: apt-get update && apt-get install -y rsync
- name: Checkout código - name: Checkout código
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 1 fetch-depth: 1
env: env:
# Usamos exactamente la misma cadena que te funcionó en NPM
GIT_CONFIG_PARAMETERS: "'url.https://git.natxocc.com/.insteadOf=http://gitea:3000/'" GIT_CONFIG_PARAMETERS: "'url.https://git.natxocc.com/.insteadOf=http://gitea:3000/'"
- name: Sincronizar archivos a Web Station - name: Sincronizar archivos
run: | run: |
# Verificamos contenido # 1. Verificamos si la carpeta existe en el NAS
ls -R docs/ if [ -d "/volume1/web/sigpro" ]; then
# Sincronizamos a la carpeta del NAS mapeada echo "Carpeta destino encontrada."
rsync -av --delete docs/ /target_folder/ else
# Permisos para asegurar que Web Station pueda leer echo "ERROR: No veo /volume1/web/sigpro. Revisa los montajes de Docker del Runner."
chmod -R 755 /target_folder exit 1
fi
# 2. Sincronizamos (el runner ya suele tener rsync o cp)
rsync -av --delete docs/ /volume1/web/sigpro/
# 3. Ajustamos permisos para Web Station
chmod -R 755 /volume1/web/sigpro/