name: Deploy continuwuity to Nomad on: push: branches: [main] paths: - 'continuwuity.hcl' - '.gitea/workflows/deploy.yml' workflow_dispatch: jobs: deploy: name: nomad job run continuwuity runs-on: debian-host env: NOMAD_ADDR: ${{ secrets.NOMAD_ADDR }} NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }} steps: - uses: actions/checkout@v4 - name: Check nomad CLI run: | if ! command -v nomad >/dev/null 2>&1; then echo "❌ nomad CLI not found on the runner (debian-host). Install it on the runner host." exit 1 fi nomad version - name: Validate job run: nomad job validate continuwuity.hcl - name: Plan (diff, non-blocking) run: | # plan exit codes: 0 = no changes, 1 = changes will be made, anything else = error set +e nomad job plan continuwuity.hcl code=$? set -e if [ "$code" -gt 1 ]; then echo "❌ nomad job plan failed (exit $code)" exit "$code" fi echo "✅ plan ok (exit $code)" - name: Run run: nomad job run continuwuity.hcl - name: Status run: nomad job status continuwuity