fix: update CI to Nix build + systemd deploy (no Docker)
Build & Deploy (Nix) / build-and-deploy (push) Failing after 5s
Build & Deploy (Nix) / build-and-deploy (push) Failing after 5s
This commit is contained in:
+11
-32
@@ -1,4 +1,4 @@
|
|||||||
name: Deploy FileDrop
|
name: Build & Deploy (Nix)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -6,43 +6,22 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Bun
|
- name: Build with Nix
|
||||||
uses: oven-sh/setup-bun@v2
|
run: |
|
||||||
with:
|
nix build .#teleuploader --impure --option sandbox false 2>&1
|
||||||
bun-version: latest
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Deploy (local — runner is on same VPS)
|
||||||
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 }}
|
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
STORE_PATH=$(readlink result)
|
||||||
key_file="${RUNNER_TEMP:-/tmp}/filedrop_deploy_key"
|
sudo nix-env --profile /nix/var/nix/profiles/teleuploader --set "$STORE_PATH"
|
||||||
printf '%s\n' "$VPS_SSH_KEY_VALUE" > "$key_file"
|
sudo systemctl restart teleuploader
|
||||||
chmod 600 "$key_file"
|
sleep 3
|
||||||
|
sudo systemctl status teleuploader --no-pager | head -15
|
||||||
printf '%s\n' "$PRODUCTION_ENV" > .env
|
|
||||||
chmod 600 .env
|
|
||||||
|
|
||||||
VPS_SSH_KEY="$key_file" ./deploy.sh --no-build
|
|
||||||
Reference in New Issue
Block a user