From 8f224f73506d9c6e4db94c4c4b0c865e60c3aa10 Mon Sep 17 00:00:00 2001 From: Michael Mainguy Date: Thu, 16 Oct 2025 10:30:44 -0500 Subject: [PATCH] update build.yml --- .github/workflows/build.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12ac802..a12d3da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,12 +17,24 @@ jobs: - name: Install dependencies run: npm ci - - name: Run build + - name: Build run: npm run build env: - NODE_OPTIONS: "--max-old-space-size=2048" + NODE_OPTIONS: '--max-old-space-size=2048' + + - name: Extract hostname from package.json + id: get-hostname + run: | + HOSTNAME=$(node -p "require('./package.json').deployHostname") + echo "hostname=$HOSTNAME" >> $GITHUB_OUTPUT - name: Deploy to nginx run: | - rm -rf /var/www/localhost/space/* - cp -r dist/* /var/www/localhost/space/ + DEPLOY_PATH="/var/www/localhost/${{ steps.get-hostname.outputs.hostname }}" + + # Create directory if it doesn't exist + mkdir -p "$DEPLOY_PATH" + + # Copy built files (overwrite existing) + cp -r dist/* "$DEPLOY_PATH/" + echo "Deployed to $DEPLOY_PATH" \ No newline at end of file