Moved build process to one that automatically picks a local runner if available, re-enabled automatic building
Build & Publish to GHCR / select-runner (push) Successful in 3s
Build & Publish to GHCR / build (push) Successful in 25s
Generate openapi.json / generate-docs (push) Successful in 33s

This commit is contained in:
florian committed 2026-11-28 18:58:59 +01:00
1 parent ac016289ed
commit b2a39d71cf
2 files changed
+34 -64

No files matched your search

+34 -1
View File
@@ -1,6 +1,8 @@
name: Build & Publish to GHCR
on:
push:
branches: [main]
workflow_dispatch:
env:
@@ -13,8 +15,39 @@ env:
OPS_PATH: service-seadex/deployment.yaml
jobs:
build:
select-runner:
runs-on: ubuntu-latest
outputs:
runner: ${{ steps.pick.outputs.runner }}
steps:
- name: Check if local runner is online
id: pick
env:
API_TOKEN: ${{ secrets.GET_AVAILABLE_RUNNERS_API_TOKEN }}
API_URL: ${{ github.server_url }}/api/v1/admin/actions/runners
run: |
RUNNER="ubuntu-latest"
RESPONSE=$(curl -fsS --max-time 15 \
-H "Authorization: token ${API_TOKEN}" \
"${API_URL}" || echo "")
if [ -n "$RESPONSE" ]; then
ONLINE=$(echo "$RESPONSE" | jq '[.runners[]?
| select(.status != "offline")
| select(any(.labels[]?; .name == "local"))] | length')
if [ "${ONLINE:-0}" -gt 0 ]; then
RUNNER="local"
fi
else
echo "Runner API not reachable, falling back to ubuntu-latest"
fi
echo "Selected runner: $RUNNER"
echo "runner=$RUNNER" >> "$GITHUB_OUTPUT"
build:
needs: select-runner
runs-on: ${{ needs.select-runner.outputs.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4