Files
archie/.gitea/workflows/deploy.yml
T
sam 8c6cf128f5 chore: document deployment, release process, and add CI gate
CLAUDE.md now describes the host+container deployment model, release
workflow, and per-package traps agents need to know about (no sensors
package, WriteTaskJSON path, long-polling drop, MCP provider hard-fail,
.dockerignore, GOTMPDIR).

CI (deploy.yml) gains a gate job that runs before the image builds:
the quality gate (fmt, vet, build, test), then a check that every
release tag at HEAD has a matching [version] section in its changelog.
A tag without a changelog entry fails the build. No tags at HEAD prints
a warning — images get stamped 'dev'.
2026-07-31 02:08:57 +10:00

102 lines
3.6 KiB
YAML

# Builds and pushes the archied and archie-agent images on every merge
# to main. carina's watchtower container (see docker-compose.yml) picks
# up the new images and restarts the running daemons -- this workflow
# never touches carina directly.
name: deploy
on:
push:
branches: [main]
tags: ["archied/v*", "archie/v*"]
jobs:
gate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.26"
- name: Quality gate
run: |
gofumpt -w .
go fix ./...
go vet ./...
go build ./...
go test ./... -count=1
- name: Release tags must match changelogs
run: |
set -e
fail=0
for tag in $(git tag --points-at HEAD); do
case "$tag" in
archied/v*)
ver="${tag#archied/}"
echo " archied tag $tag -> looking for [$ver] in CHANGELOG.archied.md"
grep -q "^## \\[$ver\\]" CHANGELOG.archied.md || {
echo " FAIL: CHANGELOG.archied.md has no [$ver] section"
fail=1
}
;;
archie/v*)
ver="${tag#archie/}"
echo " archie tag $tag -> looking for [$ver] in CHANGELOG.archie.md"
grep -q "^## \\[$ver\\]" CHANGELOG.archie.md || {
echo " FAIL: CHANGELOG.archie.md has no [$ver] section"
fail=1
}
;;
esac
done
if [ $fail -ne 0 ]; then
echo
echo "A release tag points at this commit but its changelog does not"
echo "describe that version. Run: task release:prepare VERSION=<ver>"
echo "edit the generated notes, then: task release VERSION=<ver>"
exit 1
fi
if ! git tag --points-at HEAD | grep -qE 'archie' ; then
echo "::warning ::No release tags at HEAD -- images will be stamped 'dev'"
fi
build-and-push:
needs: gate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u sam --password-stdin
- name: Build and push archied
run: |
GATEWAY_TAG="$(git tag --points-at HEAD --list 'archied/v*' | sort -V | tail -1)"
RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"
GATEWAY_VERSION="${GATEWAY_TAG#archied/}"
RUNTIME_VERSION="${RUNTIME_TAG#archie/}"
[ -n "$GATEWAY_VERSION" ] || GATEWAY_VERSION=dev
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION=dev
docker build \
--build-arg GATEWAY_VERSION="$GATEWAY_VERSION" \
--build-arg RUNTIME_VERSION="$RUNTIME_VERSION" \
-f Dockerfile.archied -t git.catlow.cloud/sam/archied:latest .
docker push git.catlow.cloud/sam/archied:latest
- name: Build and push archie-agent
run: |
RUNTIME_TAG="$(git tag --points-at HEAD --list 'archie/v*' | sort -V | tail -1)"
RUNTIME_VERSION="${RUNTIME_TAG#archie/}"
[ -n "$RUNTIME_VERSION" ] || RUNTIME_VERSION=dev
docker build --build-arg RUNTIME_VERSION="$RUNTIME_VERSION" -f Dockerfile -t git.catlow.cloud/sam/archie-agent:latest .
docker push git.catlow.cloud/sam/archie-agent:latest