From 739775ea94781cd78a986af0d6286ba8d17b146a Mon Sep 17 00:00:00 2001 From: Michael Mainguy Date: Tue, 30 Dec 2025 09:40:32 -0600 Subject: [PATCH] Fix deployment to work within /opt/immersive directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move contents instead of directory itself to avoid permission issues with gitea-runner user who has write access inside but not to /opt. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/build.yml | 16 +++++++--------- .github/workflows/main.yml | 4 ++-- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd3a67b..5a26d6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,22 +31,20 @@ jobs: - name: Deploy to /opt/immersive run: | - # Remove old deployment (keep data directory if it exists) - rm -rf /opt/immersive.old - [ -d /opt/immersive ] && mv /opt/immersive /opt/immersive.old + # Backup data directory if it exists + [ -d /opt/immersive/data ] && mv /opt/immersive/data /tmp/immersive-data + + # Remove old files (except data which we moved) + rm -rf /opt/immersive/* # Copy built files to target - mkdir -p /opt/immersive cp -r . /opt/immersive/ # Remove unnecessary directories rm -rf /opt/immersive/.git /opt/immersive/.github - # Restore data directory from old deployment if it existed - [ -d /opt/immersive.old/data ] && mv /opt/immersive.old/data /opt/immersive/ - - # Clean up old deployment - rm -rf /opt/immersive.old + # Restore data directory + [ -d /tmp/immersive-data ] && mv /tmp/immersive-data /opt/immersive/data # Set permissions on start.sh chmod +x /opt/immersive/start.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0cff3e8..9a80e24 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,9 +2,9 @@ name: Node.js CI on: push: - branches: [ "main" ] + branches: [ "deepdiagram" ] pull_request: - branches: [ "main" ] + branches: [ "deepdiagram" ] jobs: build: