Build & Deploy (Nix) / build-and-deploy (push) Failing after 46s
Diagnosing deploy failure: systemctl unavailable inside runner container. Adding inspect step to understand available mounts and access mechanisms. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
name: Build & Deploy (Nix)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Nix
|
|
run: |
|
|
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix \
|
|
| sh -s -- install --no-confirm 2>&1
|
|
echo "/nix/var/nix/profiles/default/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Build with Nix
|
|
run: |
|
|
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh || true
|
|
nix build .#teleuploader --impure --option sandbox false 2>&1
|
|
|
|
- name: Inspect container environment
|
|
run: |
|
|
echo "=== Host mounts ==="
|
|
mount | grep -E 'nix|host|proc' | head -20 || true
|
|
echo "=== /run ==="
|
|
ls -la /run/systemd/ 2>/dev/null || echo "no systemd dir"
|
|
ls -la /run/dbus/ 2>/dev/null || echo "no dbus dir"
|
|
echo "=== Docker socket ==="
|
|
ls -la /var/run/docker.sock 2>/dev/null || echo "no docker sock"
|
|
echo "=== Environment ==="
|
|
env | grep -E 'SSH|KEY|HOST|PASS|TOKEN|SECRET' | head -10 || true
|
|
|
|
- name: Deploy (local — runner is on same VPS)
|
|
run: |
|
|
set -eu
|
|
STORE_PATH=$(readlink result)
|
|
NIX_ENV="/nix/var/nix/profiles/default/bin/nix-env"
|
|
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
|