Add Gitea Actions CI: test + build/push image on main
Tests on every push/PR; on main, builds and pushes
git.jpaul.io/justin/ag-bids-mcp:{latest,sha} to the Gitea registry. The .0.2
act_runner has the host docker.sock mounted, so plain docker build/push work.
Watchtower on .0.2 then auto-deploys :latest within ~5 min.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
# Test on every push/PR; build + push the image only on main.
|
||||||
|
# The act_runner on .0.2 has the host docker.sock mounted (DOCKER_HOST is
|
||||||
|
# preset), so plain `docker build`/`docker push` work with no DinD setup.
|
||||||
|
# Watchtower on .0.2 auto-pulls git.jpaul.io/justin/ag-bids-mcp:latest within
|
||||||
|
# ~5 min, so a successful push here is the whole deploy.
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE: git.jpaul.io/justin/ag-bids-mcp
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install + run tests
|
||||||
|
run: |
|
||||||
|
python3 -m pip install --quiet --upgrade pip
|
||||||
|
python3 -m pip install --quiet -r requirements.txt pytest
|
||||||
|
python3 -m pytest -q
|
||||||
|
|
||||||
|
build-push:
|
||||||
|
needs: test
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
# Auth to the Gitea container registry. The auto-provisioned job token
|
||||||
|
# works for the repo owner's package namespace in the common config; if a
|
||||||
|
# run ever fails here with a permissions error, add a repo Actions secret
|
||||||
|
# REGISTRY_TOKEN (a PAT with write:package) and swap secrets.GITHUB_TOKEN
|
||||||
|
# for secrets.REGISTRY_TOKEN below.
|
||||||
|
- name: Log in to registry
|
||||||
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login git.jpaul.io -u "${{ github.actor }}" --password-stdin
|
||||||
|
- name: Build + push
|
||||||
|
run: |
|
||||||
|
docker build -t "$IMAGE:latest" -t "$IMAGE:${{ github.sha }}" .
|
||||||
|
docker push "$IMAGE:latest"
|
||||||
|
docker push "$IMAGE:${{ github.sha }}"
|
||||||
Reference in New Issue
Block a user