fix: update CI to Nix build + systemd deploy (no Docker)
Build & Deploy (Nix) / build-and-deploy (push) Failing after 5s

This commit is contained in:
Claude
2026-07-30 15:08:23 +07:00
parent bc3d1f2e3f
commit c26ca806d0
+11 -32
View File
@@ -1,4 +1,4 @@
name: Deploy FileDrop
name: Build & Deploy (Nix)
on:
push:
@@ -6,43 +6,22 @@ on:
- main
jobs:
deploy:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Build with Nix
run: |
nix build .#teleuploader --impure --option sandbox false 2>&1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint
run: bun run lint
- name: Build
run: bun run build
- name: Deploy to VPS
shell: bash
env:
VPS_HOST: ${{ secrets.VPS_HOST }}
VPS_USER: ${{ secrets.VPS_USER }}
VPS_SSH_KEY_VALUE: ${{ secrets.VPS_SSH_KEY }}
PRODUCTION_ENV: ${{ secrets.PRODUCTION_ENV }}
ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }}
- name: Deploy (local — runner is on same VPS)
run: |
set -eu
key_file="${RUNNER_TEMP:-/tmp}/filedrop_deploy_key"
printf '%s\n' "$VPS_SSH_KEY_VALUE" > "$key_file"
chmod 600 "$key_file"
printf '%s\n' "$PRODUCTION_ENV" > .env
chmod 600 .env
VPS_SSH_KEY="$key_file" ./deploy.sh --no-build
STORE_PATH=$(readlink result)
sudo nix-env --profile /nix/var/nix/profiles/teleuploader --set "$STORE_PATH"
sudo systemctl restart teleuploader
sleep 3
sudo systemctl status teleuploader --no-pager | head -15