diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 97fe3d0..b158eb8 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -52,3 +52,39 @@ jobs: echo "==> $f" nomad job validate "$f" done + + image-pull: + name: Docker image pull validation + runs-on: ubuntu-latest + # Only run on PRs that touch nomad job specs + if: github.event_name == 'pull_request' + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Pull changed images + run: | + git fetch origin ${{ github.base_ref }} + IMAGES=$(git diff origin/${{ github.base_ref }}...HEAD -- '*.nomad.hcl' \ + | grep '^+\s*image\s*=' \ + | grep -oP '"[^"]+:[^"]+"' \ + | tr -d '"' \ + | sort -u) + + if [ -z "$IMAGES" ]; then + echo "No image changes detected, skipping pull." + exit 0 + fi + + FAILED=0 + while IFS= read -r image; do + echo "==> Pulling $image" + if ! docker pull "$image"; then + echo "ERROR: Failed to pull $image" + FAILED=1 + fi + done <<< "$IMAGES" + + exit $FAILED diff --git a/2-nomad-config/act-runner.nomad.hcl b/2-nomad-config/act-runner.nomad.hcl index c082d72..8abd6d2 100644 --- a/2-nomad-config/act-runner.nomad.hcl +++ b/2-nomad-config/act-runner.nomad.hcl @@ -29,7 +29,6 @@ job "act-runner" { env = { GITEA_INSTANCE_URL = "https://gitea-1ef0bea6b75a4fd3e9393a9f7f7e4b02.othrayte.one" - CONFIG_FILE = "/secrets/runner-config.yml" } # Required SOPS key: @@ -43,19 +42,6 @@ EOF env = true } - # Limit which images/labels the runner will accept so it doesn't pick up - # unrelated workloads if more runners are added later. - template { - data = <