Scaffold: deploy workflow, AGENTS/CLAUDE/README
Some checks are pending
/ deploy (push) Waiting to run
Some checks are pending
/ deploy (push) Waiting to run
This commit is contained in:
parent
6774148618
commit
65dfd25236
4 changed files with 114 additions and 1 deletions
25
.forgejo/workflows/deploy.yml
Normal file
25
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Restart Nomad allocation
|
||||
env:
|
||||
NOMAD_ADDR: ${{ secrets.NOMAD_ADDR }}
|
||||
NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}
|
||||
run: |
|
||||
set -e
|
||||
ALLOC_ID=$(curl -sf \
|
||||
-H "X-Nomad-Token: $NOMAD_TOKEN" \
|
||||
"$NOMAD_ADDR/v1/job/familyfed/allocations" \
|
||||
| python3 -c "import sys,json; allocs=json.load(sys.stdin); print(next(a['ID'] for a in allocs if a['ClientStatus']=='running'))")
|
||||
echo "Stopping allocation to trigger fresh prestart: $ALLOC_ID"
|
||||
curl -sf -X POST \
|
||||
-H "X-Nomad-Token: $NOMAD_TOKEN" \
|
||||
"$NOMAD_ADDR/v1/allocation/$ALLOC_ID/stop"
|
||||
echo "Deploy triggered — Nomad will schedule a new alloc that re-fetches the site."
|
||||
Loading…
Add table
Add a link
Reference in a new issue