Fix test workflow for host mode, add custom runner image plan
Some checks failed
Test CI / test (pull_request) Failing after 0s
Some checks failed
Test CI / test (pull_request) Failing after 0s
- Use git clone instead of actions/checkout (no Node.js in runner) - Add Use Case 0 to P4: build custom runner image with Node.js The stock forgejo/runner image lacks Node.js, so standard GitHub Actions don't work in host mode. P4 now includes building a custom runner image as the first step. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
70f2227313
commit
b2c5716e21
2 changed files with 79 additions and 1 deletions
|
|
@ -10,7 +10,12 @@ jobs:
|
|||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout (git clone)
|
||||
run: |
|
||||
git clone --depth 1 --branch "${{ gitea.ref_name }}" \
|
||||
"${{ gitea.server_url }}/${{ gitea.repository }}.git" .
|
||||
env:
|
||||
GIT_SSL_NO_VERIFY: "true"
|
||||
|
||||
- name: Hello World
|
||||
run: |
|
||||
|
|
@ -18,3 +23,4 @@ jobs:
|
|||
echo "Runner: $(hostname)"
|
||||
echo "Repository: ${{ gitea.repository }}"
|
||||
echo "Branch: ${{ gitea.ref_name }}"
|
||||
ls -la
|
||||
|
|
|
|||
|
|
@ -17,6 +17,78 @@ With Forgejo Actions operational, we can now build container images for:
|
|||
|
||||
---
|
||||
|
||||
## Use Case 0: Custom Runner Image
|
||||
|
||||
### Problem
|
||||
|
||||
The stock `forgejo/runner` image lacks tools needed for standard GitHub Actions:
|
||||
- **Node.js** - Required by most actions (checkout, setup-*, etc.)
|
||||
- **Docker CLI** - For building container images
|
||||
- **Git** - For repository operations
|
||||
- **Common build tools** - make, gcc, etc.
|
||||
|
||||
In host mode, jobs run directly in the runner container, so these tools must be pre-installed.
|
||||
|
||||
### Solution
|
||||
|
||||
Build a custom runner image with all necessary tools:
|
||||
|
||||
```dockerfile
|
||||
# argocd/manifests/forgejo-runner/Dockerfile
|
||||
FROM code.forgejo.org/forgejo/runner:3.5.1
|
||||
|
||||
# Install Node.js (required for most GitHub Actions)
|
||||
RUN apt-get update && apt-get install -y \
|
||||
nodejs \
|
||||
npm \
|
||||
git \
|
||||
curl \
|
||||
docker.io \
|
||||
make \
|
||||
gcc \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
```
|
||||
|
||||
### Workflow
|
||||
|
||||
Create `.forgejo/workflows/build-runner.yml`:
|
||||
|
||||
```yaml
|
||||
name: Build Runner Image
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'argocd/manifests/forgejo-runner/Dockerfile'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone --depth 1 "${{ gitea.server_url }}/${{ gitea.repository }}.git" .
|
||||
|
||||
- name: Build and push
|
||||
run: |
|
||||
cd argocd/manifests/forgejo-runner
|
||||
docker build -t registry.tail8d86e.ts.net/blumeops/forgejo-runner:latest .
|
||||
docker push registry.tail8d86e.ts.net/blumeops/forgejo-runner:latest
|
||||
```
|
||||
|
||||
### Update Deployment
|
||||
|
||||
Once the custom image is built, update `argocd/manifests/forgejo-runner/deployment.yaml`:
|
||||
|
||||
```yaml
|
||||
image: registry.tail8d86e.ts.net/blumeops/forgejo-runner:latest
|
||||
```
|
||||
|
||||
This enables standard GitHub Actions like `actions/checkout@v4` to work in host mode.
|
||||
|
||||
---
|
||||
|
||||
## Use Case 1: devpi Custom Image
|
||||
|
||||
### Current State
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue