All checks were successful
Build and Deploy / build (push) Successful in 1m35s
Use find to delete all files except data directory instead of moving to /tmp which fails due to sticky bit permissions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: linux_amd64
|
|
timeout-minutes: 15
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
timeout-minutes: 5
|
|
|
|
- name: Build Front End
|
|
run: npm run build
|
|
timeout-minutes: 10
|
|
env:
|
|
NODE_OPTIONS: '--max-old-space-size=4096'
|
|
|
|
- name: Stop Service
|
|
run: |
|
|
sudo rc-service immersive stop || true
|
|
|
|
- name: Deploy to /opt/immersive
|
|
run: |
|
|
# Remove old files except data directory
|
|
find /opt/immersive -mindepth 1 -maxdepth 1 ! -name 'data' -exec rm -rf {} +
|
|
|
|
# Copy built files to target
|
|
cp -r . /opt/immersive/
|
|
|
|
# Remove unnecessary directories
|
|
rm -rf /opt/immersive/.git /opt/immersive/.github
|
|
|
|
# Set permissions on start.sh
|
|
chmod +x /opt/immersive/start.sh
|
|
|
|
# Set ownership to immersive user
|
|
sudo chown -R immersive:immersive /opt/immersive
|
|
|
|
- name: Start Service
|
|
run: |
|
|
sudo rc-service immersive start |