7884fb1c5f
- pgsync.go: filter rows where enabled IS NOT FALSE and domain IS NOT NULL, matching the existing automc servers table (domain nullable, enabled defaults true). Trigger doc now includes UPDATE OF enabled. - .gitea/workflows/ci.yaml: build/test on push to automc branch + tags, publish container as git.timemachine.center/timemachine/mc-router:automc. - FORK.md: soft-fork relationship doc at repo root. - docs/AUTOMC.md: quick-start recipe, troubleshooting table, sync-lifecycle and waker-dispatch sequence diagrams.
55 lines
1.5 KiB
YAML
55 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [automc]
|
|
tags: ["automc-v*"]
|
|
pull_request:
|
|
branches: [automc]
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
- name: Build
|
|
run: go build ./...
|
|
- name: Vet
|
|
run: go vet ./...
|
|
- name: Test automc package
|
|
run: go test ./internal/automc/...
|
|
- name: Test full suite
|
|
run: go test ./...
|
|
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
needs: validate
|
|
if: github.event_name == 'push'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Compute tags
|
|
id: meta
|
|
run: |
|
|
if [[ "$GITEA_REF" == refs/tags/automc-v* ]]; then
|
|
echo "tag=${GITEA_REF#refs/tags/}" >> "$GITEA_OUTPUT"
|
|
else
|
|
echo "tag=automc" >> "$GITEA_OUTPUT"
|
|
fi
|
|
echo "sha=sha-$(echo "$GITEA_SHA" | cut -c1-7)" >> "$GITEA_OUTPUT"
|
|
|
|
- name: Login to registry
|
|
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.timemachine.center -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
|
|
|
- name: Build and push
|
|
run: |
|
|
IMG=git.timemachine.center/timemachine/${{ gitea.event.repository.name }}
|
|
docker build -t "$IMG:${{ steps.meta.outputs.tag }}" -t "$IMG:${{ steps.meta.outputs.sha }}" .
|
|
docker push "$IMG:${{ steps.meta.outputs.tag }}"
|
|
docker push "$IMG:${{ steps.meta.outputs.sha }}"
|