graylog-deploy/.forgejo/workflows/deploy-from-scratch.yml
byrsapty 71ba82e0f0 Add a host-level CI runner + one-click "deploy from scratch" workflow
setup-forgejo-runner.sh gained RUNNER_LABEL/RUNNER_DIR/SERVICE_NAME/
RUNNER_USER params so the same script can register either kind of runner:
- inside the container (unchanged defaults, root - already scoped to just
  that container)
- on the Proxmox host itself, where RUNNER_USER=claude-deploy is required:
  a root-owned systemd service with no User= would hand every CI job
  unrestricted root on the host, defeating the whole point of
  claude-deploy's narrowly-scoped sudoers rules.

deploy-from-scratch.yml runs create-graylog-lxc.sh on the host-level
runner. Deliberately does NOT run pct destroy - that stays a manual,
deliberate human step. The idempotent create+install path is safe to
trigger any time: repairs an existing container in place, or fully
recreates one if it was destroyed beforehand.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 22:40:20 +03:00

36 lines
1.5 KiB
YAML

name: Deploy Graylog from scratch (host-level)
on:
workflow_dispatch:
jobs:
deploy:
runs-on: proxmox-host
steps:
# No actions/checkout: same reasoning as deploy.yml - this runner has
# no Node.js and shouldn't need one just for CI checkout.
#
# Destroying the existing container (pct destroy) is deliberately NOT
# part of this workflow - that stays a manual, deliberate step run by
# a human on the Proxmox host. This workflow only re-runs the
# idempotent create+install path, safe to trigger any time: if VMID
# 200 already exists it just repairs/updates it in place; if it was
# destroyed manually beforehand, this recreates it from scratch.
- name: Deploy from scratch
env:
CI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
rm -rf /tmp/graylog-deploy-ci-host
git clone --depth 1 --branch main "https://x-access-token:${CI_TOKEN}@git.zotac.keenetic.link/zotac/graylog-deploy.git" /tmp/graylog-deploy-ci-host
cd /tmp/graylog-deploy-ci-host
chmod +x create-graylog-lxc.sh
./create-graylog-lxc.sh \
--vmid 200 \
--ip 10.254.254.202/24 \
--gw 10.254.254.235 \
--vlan 1254 \
--disk 50 \
--template-storage local-btrfs \
--rootfs-storage EX-Ceph \
--external-uri http://93.171.241.5:9000/ \
--discord-webhook "$DISCORD_WEBHOOK_URL"