Files
flock/.gitea/workflows/main.yaml
T
Donavan Fritz e0ae98ad6c
Build flock Image / build (push) Has been cancelled
ci: move go test into Dockerfile build stage
The runner runs jobs via act + DinD; `docker run -v "$PWD:/src"` from
inside the job container mounts the runner-job filesystem, not the
docker daemon's host fs, so the mount appears empty and `go test ./...`
fails with "directory prefix . does not contain main module".

Run tests in the same container that builds — same workspace, no mount.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 21:19:10 -05:00

56 lines
1.8 KiB
YAML

name: Build flock Image
on:
push:
branches: [main]
jobs:
build:
runs-on: fritzlab
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Log in to Gitea registry
uses: docker/login-action@v3
with:
registry: code.fritzlab.net
username: ci-bot
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: code.fritzlab.net/fritzlab/flock
tags: |
type=raw,value=latest
type=raw,value=${{ github.run_number }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
provenance: false
build-args: |
GIT_SHA=${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
network: host
- name: Smoke-test image
run: |
docker run --rm code.fritzlab.net/fritzlab/flock:${{ github.run_number }} --help || true
docker run --rm --entrypoint /usr/local/bin/flock \
code.fritzlab.net/fritzlab/flock:${{ github.run_number }} || true
- name: Clean up old image tags
run: |
tea login add --name ci --url https://code.fritzlab.net --token '${{ secrets.CI_BOT_TOKEN }}' --no-version-check
tea api '/packages/fritzlab?type=container' \
| jq -r '.[] | select(.name=="flock") | select(.version | test("^[0-9]+$")) | .version' \
| sort -n | head -n -3 \
| while read tag; do
echo "deleting flock:$tag"
tea api -X DELETE "/packages/fritzlab/container/flock/$tag"
done