Fix: Usa options per il mount del volume1
Deploy Docusaurus / build-and-deploy (push) Successful in 3m5s
Details
Deploy Docusaurus / build-and-deploy (push) Successful in 3m5s
Details
This commit is contained in:
parent
4e0aecd8c3
commit
53d8de49b0
|
|
@ -10,26 +10,13 @@ jobs:
|
|||
runs-on: docker
|
||||
container:
|
||||
image: node:20-bookworm
|
||||
# 👇 QUESTA È LA CHIAVE: Montiamo la cartella fisica del server dentro il container Node
|
||||
options: --volume /opt/forgejo/sites/docs:/deploy/docs
|
||||
#volumes:
|
||||
# - /opt/forgejo/sites/docs:/deploy/docs
|
||||
|
||||
steps:
|
||||
- name: Checkout del codice
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- 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 ci
|
||||
run: npm install
|
||||
|
||||
- name: Build Docusaurus
|
||||
run: |
|
||||
|
|
@ -41,14 +28,16 @@ jobs:
|
|||
TARGET_DIR="/deploy/docs"
|
||||
echo "Inizio deploy su $TARGET_DIR..."
|
||||
|
||||
# Crea la directory se non esiste
|
||||
mkdir -p $TARGET_DIR
|
||||
|
||||
# Pulisce la cartella di destinazione
|
||||
# (Attenzione: rm -rf su cartella montata cancella i file reali sul server!)
|
||||
rm -rf $TARGET_DIR/*
|
||||
|
||||
# Copia i nuovi file
|
||||
cp -r build/* $TARGET_DIR/
|
||||
|
||||
# 👇 SICUREZZA PERMESSI: Assicuriamoci che Nginx possa leggerli
|
||||
# Permessi per Nginx
|
||||
chmod -R 755 $TARGET_DIR
|
||||
|
||||
echo "Deploy completato con successo e permessi aggiornati!"
|
||||
echo "Deploy completato con successo!"
|
||||
Loading…
Reference in New Issue