From 1a832b3d678fb5c3407f3003be8480f3ad8af706 Mon Sep 17 00:00:00 2001 From: DFFM-maker Date: Fri, 2 Jan 2026 15:28:06 +0100 Subject: [PATCH] Fix: Mount volume host nel container di build --- .github/workflows/deploy.yml | 45 +++++++++++++++++---------------- yarn.lock | 49 +++++++++++++++--------------------- 2 files changed, 44 insertions(+), 50 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2c48d36..bb4576d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,48 +3,51 @@ name: Deploy Docusaurus on: push: branches: - - main # Esegue il deploy solo quando pushi su main + - main jobs: build-and-deploy: - # โš ๏ธ FONDAMENTALE: Questa label deve combaciare con quella del tuo Runner runs-on: docker - - # Usiamo un container Node per costruire il sito (come facevi su GitLab) container: 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: - name: Checkout del codice uses: actions/checkout@v4 - # Installa le dipendenze - # Cambiato da 'npm ci' a 'npm install' per gestire automaticamente - # eventuali disallineamenti tra package.json e package-lock.json + - name: Cache Node Modules + id: cache-npm + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Installazione Dipendenze - run: npm install + run: npm ci - # Costruisce il sito (crea la cartella 'build') - 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 run: | - # Questa cartella /deploy/docs รจ il volume condiviso che abbiamo creato nel docker-compose TARGET_DIR="/deploy/docs" - echo "Inizio deploy su $TARGET_DIR..." - # Crea la cartella se non esiste - mkdir -p $TARGET_DIR - - # Pulisce la cartella di destinazione (rimuove il vecchio sito) + # Pulisce la cartella di destinazione + # (Attenzione: rm -rf su cartella montata cancella i file reali sul server!) rm -rf $TARGET_DIR/* - # Copia il nuovo sito appena compilato - # (Docusaurus mette tutto in 'build', noi lo spostiamo nella cartella pubblica) + # Copia i nuovi file cp -r build/* $TARGET_DIR/ - echo "Deploy completato con successo!" \ No newline at end of file + # ๐Ÿ‘‡ SICUREZZA PERMESSI: Assicuriamoci che Nginx possa leggerli + chmod -R 755 $TARGET_DIR + + echo "Deploy completato con successo e permessi aggiornati!" \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 79a0877..b54c3b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6206,7 +6206,7 @@ hyperdyperid@^1.2.0: resolved "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz" 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" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz" integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== @@ -6220,20 +6220,6 @@ iconv-lite@~0.4.24: dependencies: 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: version "5.1.0" 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" 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" resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -9098,12 +9084,13 @@ rc@1.2.8: minimist "^1.2.0" 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": - version "19.1.1" - resolved "https://registry.npmjs.org/react-dom/-/react-dom-19.1.1.tgz" - integrity sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw== +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 "18.3.1" + resolved "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz" + integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw== dependencies: - scheduler "^0.26.0" + loose-envify "^1.1.0" + scheduler "^0.23.2" react-fast-compare@^3.2.0: 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-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: - version "19.2.3" - resolved "https://registry.npmjs.org/react/-/react-19.2.3.tgz" - integrity sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA== +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 "18.3.1" + resolved "https://registry.npmjs.org/react/-/react-18.3.1.tgz" + integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ== + dependencies: + loose-envify "^1.1.0" readable-stream@^2.0.1: version "2.3.8" @@ -9603,10 +9592,12 @@ sax@^1.2.4: resolved "https://registry.npmjs.org/sax/-/sax-1.4.3.tgz" integrity sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ== -scheduler@^0.26.0: - version "0.26.0" - resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz" - integrity sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA== +scheduler@^0.23.2: + version "0.23.2" + resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz" + integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ== + dependencies: + loose-envify "^1.1.0" schema-dts@^1.1.2: version "1.1.5"