43 lines
1.6 KiB
YAML
43 lines
1.6 KiB
YAML
name: Build and Push agentchat Image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
quality:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: 1.3.14
|
|
- run: bun install --frozen-lockfile
|
|
- name: Typecheck and test
|
|
run: |
|
|
bun run typecheck
|
|
bun test
|
|
|
|
build-image:
|
|
needs: [quality]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Log in to container registry
|
|
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.gbrown.org -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
|
# One build-and-push step, fully-qualified tags, --push from the builder.
|
|
# This is the only form that works across all the runners: unqualified
|
|
# names resolve to docker.io/library/* on podman-backed daemons, and
|
|
# buildx docker-container drivers keep plain builds in the build cache
|
|
# where a separate push step can't see them.
|
|
- name: Build and push image
|
|
run: docker build --push -f docker/Dockerfile -t git.gbrown.org/gib/agentchat:${{ gitea.sha }} -t git.gbrown.org/gib/agentchat:latest .
|
|
|
|
# Watchtower on the VPS updates labelled containers nightly at 04:30; this
|
|
# asks it to do so immediately. Non-fatal: the sweep still catches it.
|
|
- name: Trigger immediate deploy via Watchtower API
|
|
run: |
|
|
curl -fsS -X POST -H "Authorization: Bearer ${{ secrets.WATCHTOWER_TOKEN }}" \
|
|
http://192.168.2.2:8080/v1/update \
|
|
|| echo "::warning::watchtower trigger failed; nightly sweep will deploy instead"
|