ci: use base runner + git clone (no Node.js dependency)
Build and push runner images / build-runners (pull_request) Failing after 6s
Build and push runner images / build-runners (pull_request) Failing after 6s
Problem: actions/checkout@v4 requires Node.js, but base forgejo/runner:6 (Alpine) doesn't have it. We need to test our Dockerfiles on the bare base image. Solution: - runs-on: golang (base Alpine runner with dind docker) - Replace actions/checkout@v4 with git clone (no Node.js needed) - Clone to /workspace, run all steps there - Only push on push events (skip on PR to avoid registry pollution) This validates that our Dockerfile fixes work correctly on base image.
This commit is contained in:
@@ -17,22 +17,27 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-runners:
|
build-runners:
|
||||||
runs-on: node
|
runs-on: golang
|
||||||
env:
|
env:
|
||||||
REGISTRY: forgejo.riotpiao.com
|
REGISTRY: forgejo.riotpiao.com
|
||||||
IMAGE_BASE: forgejo.riotpiao.com/rock
|
IMAGE_BASE: forgejo.riotpiao.com/rock
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Clone repository (base image, no Node.js required)
|
||||||
uses: actions/checkout@v4
|
run: |
|
||||||
|
git clone --depth 1 https://forgejo.riotpiao.com/rock/homelab.git /workspace
|
||||||
|
cd /workspace
|
||||||
|
|
||||||
- name: Get short SHA
|
- name: Get commit SHA
|
||||||
id: sha
|
id: sha
|
||||||
run: |
|
run: |
|
||||||
|
cd /workspace
|
||||||
SHORT_SHA=$(git rev-parse --short HEAD)
|
SHORT_SHA=$(git rev-parse --short HEAD)
|
||||||
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
|
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Got SHA: ${SHORT_SHA}"
|
||||||
|
|
||||||
- name: Build all runner images (test on PR, push on main)
|
- name: Build all runner images (test on PR, push on main)
|
||||||
run: |
|
run: |
|
||||||
|
cd /workspace
|
||||||
set -e
|
set -e
|
||||||
for RUNNER in golang rust node; do
|
for RUNNER in golang rust node; do
|
||||||
echo "📦 Building ${RUNNER}-runner..."
|
echo "📦 Building ${RUNNER}-runner..."
|
||||||
@@ -54,7 +59,6 @@ jobs:
|
|||||||
docker push "${IMAGE_BASE}/forgejo-runner-${RUNNER}:latest"
|
docker push "${IMAGE_BASE}/forgejo-runner-${RUNNER}:latest"
|
||||||
echo "✅ Pushed ${RUNNER}-runner"
|
echo "✅ Pushed ${RUNNER}-runner"
|
||||||
done
|
done
|
||||||
echo "✅ All runner images pushed to registry"
|
|
||||||
env:
|
env:
|
||||||
REGISTRY_USER: ${{ secrets.FORGEJO_REGISTRY_USER }}
|
REGISTRY_USER: ${{ secrets.FORGEJO_REGISTRY_USER }}
|
||||||
REGISTRY_TOKEN: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
|
REGISTRY_TOKEN: ${{ secrets.FORGEJO_REGISTRY_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user