Fix: Mount volume host nel container di build
Deploy Docusaurus / build-and-deploy (push) Failing after 4m54s Details

This commit is contained in:
DFFM-maker 2026-01-02 15:28:06 +01:00
parent 7b99aee064
commit 1a832b3d67
2 changed files with 44 additions and 50 deletions

View File

@ -3,48 +3,51 @@ name: Deploy Docusaurus
on: on:
push: push:
branches: branches:
- main # Esegue il deploy solo quando pushi su main - main
jobs: jobs:
build-and-deploy: build-and-deploy:
# ⚠️ FONDAMENTALE: Questa label deve combaciare con quella del tuo Runner
runs-on: docker runs-on: docker
# Usiamo un container Node per costruire il sito (come facevi su GitLab)
container: container:
image: node:20-bookworm image: node:20-bookworm
# 👇 QUESTA È LA CHIAVE: Montiamo la cartella fisica del server dentro il container Node
volumes:
- /opt/forgejo/sites/docs:/deploy/docs
steps: steps:
- name: Checkout del codice - name: Checkout del codice
uses: actions/checkout@v4 uses: actions/checkout@v4
# Installa le dipendenze - name: Cache Node Modules
# Cambiato da 'npm ci' a 'npm install' per gestire automaticamente id: cache-npm
# eventuali disallineamenti tra package.json e package-lock.json uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Installazione Dipendenze - name: Installazione Dipendenze
run: npm install run: npm ci
# Costruisce il sito (crea la cartella 'build')
- name: Build Docusaurus - name: Build Docusaurus
run: npm run build run: |
export NODE_OPTIONS="--max-old-space-size=4096"
npm run build
# FASE DI DEPLOY (Sostituisce la parte 'pages' di GitLab)
# Invece di usare gli artifacts di GitLab, copiamo i file fisicamente sul server
- name: Pubblica sul Server - name: Pubblica sul Server
run: | run: |
# Questa cartella /deploy/docs è il volume condiviso che abbiamo creato nel docker-compose
TARGET_DIR="/deploy/docs" TARGET_DIR="/deploy/docs"
echo "Inizio deploy su $TARGET_DIR..." echo "Inizio deploy su $TARGET_DIR..."
# Crea la cartella se non esiste # Pulisce la cartella di destinazione
mkdir -p $TARGET_DIR # (Attenzione: rm -rf su cartella montata cancella i file reali sul server!)
# Pulisce la cartella di destinazione (rimuove il vecchio sito)
rm -rf $TARGET_DIR/* rm -rf $TARGET_DIR/*
# Copia il nuovo sito appena compilato # Copia i nuovi file
# (Docusaurus mette tutto in 'build', noi lo spostiamo nella cartella pubblica)
cp -r build/* $TARGET_DIR/ cp -r build/* $TARGET_DIR/
echo "Deploy completato con successo!" # 👇 SICUREZZA PERMESSI: Assicuriamoci che Nginx possa leggerli
chmod -R 755 $TARGET_DIR
echo "Deploy completato con successo e permessi aggiornati!"

View File

@ -6206,7 +6206,7 @@ hyperdyperid@^1.2.0:
resolved "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz" resolved "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz"
integrity sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A== integrity sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==
iconv-lite@^0.6.3: iconv-lite@^0.6.3, iconv-lite@0.6, iconv-lite@0.6.3:
version "0.6.3" version "0.6.3"
resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz"
integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
@ -6220,20 +6220,6 @@ iconv-lite@~0.4.24:
dependencies: dependencies:
safer-buffer ">= 2.1.2 < 3" safer-buffer ">= 2.1.2 < 3"
iconv-lite@0.6:
version "0.6.3"
resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz"
integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"
iconv-lite@0.6.3:
version "0.6.3"
resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz"
integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"
icss-utils@^5.0.0, icss-utils@^5.1.0: icss-utils@^5.0.0, icss-utils@^5.1.0:
version "5.1.0" version "5.1.0"
resolved "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz" resolved "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz"
@ -7013,7 +6999,7 @@ longest-streak@^3.0.0:
resolved "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz" resolved "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz"
integrity sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g== integrity sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==
loose-envify@^1.0.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0: loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@ -9098,12 +9084,13 @@ rc@1.2.8:
minimist "^1.2.0" minimist "^1.2.0"
strip-json-comments "~2.0.1" strip-json-comments "~2.0.1"
react-dom@*, "react-dom@^16.14.0 || 17 || ^18 || ^19", "react-dom@^16.6.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom@^18.0.0 || ^19.0.0", react-dom@^19.0.0, "react-dom@>= 16.8.0 < 20.0.0": react-dom@*, "react-dom@^16.14.0 || 17 || ^18 || ^19", "react-dom@^16.6.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom@^18.0.0 || ^19.0.0", react-dom@^18.3.1, "react-dom@>= 16.8.0 < 20.0.0":
version "19.1.1" version "18.3.1"
resolved "https://registry.npmjs.org/react-dom/-/react-dom-19.1.1.tgz" resolved "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz"
integrity sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw== integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
dependencies: dependencies:
scheduler "^0.26.0" loose-envify "^1.1.0"
scheduler "^0.23.2"
react-fast-compare@^3.2.0: react-fast-compare@^3.2.0:
version "3.2.2" version "3.2.2"
@ -9180,10 +9167,12 @@ react-router@^5.3.4, react-router@>=5, react-router@5.3.4:
tiny-invariant "^1.0.2" tiny-invariant "^1.0.2"
tiny-warning "^1.0.0" tiny-warning "^1.0.0"
react@*, "react@^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react@^16.14.0 || ^17 || ^18 || ^19", "react@^16.6.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react@^18 || ~19.0.1 || ~19.1.2 || ^19.2.1", "react@^18.0.0 || ^19.0.0", react@^19.0.0, react@^19.1.1, "react@>= 16.8.0 < 20.0.0", react@>=15, react@>=16, react@>=16.0.0: react@*, "react@^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react@^16.14.0 || ^17 || ^18 || ^19", "react@^16.6.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react@^18 || ~19.0.1 || ~19.1.2 || ^19.2.1", "react@^18.0.0 || ^19.0.0", react@^18.3.1, "react@>= 16.8.0 < 20.0.0", react@>=15, react@>=16, react@>=16.0.0:
version "19.2.3" version "18.3.1"
resolved "https://registry.npmjs.org/react/-/react-19.2.3.tgz" resolved "https://registry.npmjs.org/react/-/react-18.3.1.tgz"
integrity sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA== integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
dependencies:
loose-envify "^1.1.0"
readable-stream@^2.0.1: readable-stream@^2.0.1:
version "2.3.8" version "2.3.8"
@ -9603,10 +9592,12 @@ sax@^1.2.4:
resolved "https://registry.npmjs.org/sax/-/sax-1.4.3.tgz" resolved "https://registry.npmjs.org/sax/-/sax-1.4.3.tgz"
integrity sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ== integrity sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==
scheduler@^0.26.0: scheduler@^0.23.2:
version "0.26.0" version "0.23.2"
resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz" resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz"
integrity sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA== integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==
dependencies:
loose-envify "^1.1.0"
schema-dts@^1.1.2: schema-dts@^1.1.2:
version "1.1.5" version "1.1.5"