@@ -2,6 +2,7 @@ name: Deploy Storybook to Cloudflare Workers
22permissions :
33 contents : read
44 pull-requests : write
5+ issues : write
56on :
67 push :
78 branches :
3132 with :
3233 run_install : false
3334
35+ - name : Cache APT Packages
36+ uses : awalsh128/cache-apt-pkgs-action@v1.4.3
37+ with :
38+ packages : bash procps python3 libvirt-dev jq zstd git build-essential libvirt-daemon-system
39+ version : 1.0
40+
41+ - name : Setup libvirt
42+ run : |
43+ # Create required groups (if they don't already exist)
44+ sudo groupadd -f libvirt
45+ sudo groupadd -f kvm
46+
47+ # Create libvirt user if not present, and add it to the kvm group
48+ sudo useradd -m -s /bin/bash -g libvirt libvirt || true
49+ sudo usermod -aG kvm libvirt || true
50+
51+ # Set up libvirt directories and permissions
52+ sudo mkdir -p /var/run/libvirt /var/log/libvirt /etc/libvirt
53+ sudo chown root:libvirt /var/run/libvirt /var/log/libvirt
54+ sudo chmod g+w /var/run/libvirt /var/log/libvirt
55+
56+ # Configure libvirt by appending required settings
57+ sudo tee -a /etc/libvirt/libvirtd.conf > /dev/null <<EOF
58+ unix_sock_group = "libvirt"
59+ unix_sock_rw_perms = "0770"
60+ auth_unix_rw = "none"
61+ EOF
62+
63+ # Add the current user to libvirt and kvm groups (note: this change won't apply to the current session)
64+ sudo usermod -aG libvirt,kvm $USER
65+
66+ sudo mkdir -p /var/run/libvirt
67+ sudo chown root:libvirt /var/run/libvirt
68+ sudo chmod 775 /var/run/libvirt
69+
70+ # Start libvirtd in the background
71+ sudo /usr/sbin/libvirtd --daemon
72+
73+ # Wait a bit longer for libvirtd to start
74+ sleep 5
75+
76+ # Verify libvirt is running using sudo to bypass group membership delays
77+ sudo virsh list --all || true
78+
3479 - name : Install dependencies
3580 run : pnpm install --frozen-lockfile
3681
0 commit comments