Some checks failed
Build and Deploy / build (push) Failing after 1m29s
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 <noreply@anthropic.com>
57 lines
1.4 KiB
YAML
57 lines
1.4 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: |
|
|
# 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
|
|
cp -r . /opt/immersive/
|
|
|
|
# Remove unnecessary directories
|
|
rm -rf /opt/immersive/.git /opt/immersive/.github
|
|
|
|
# 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
|
|
|
|
# Set ownership to immersive user
|
|
sudo chown -R immersive:immersive /opt/immersive
|
|
|
|
- name: Start Service
|
|
run: |
|
|
sudo rc-service immersive start |