File tree Expand file tree Collapse file tree 3 files changed +19
-21
lines changed
Expand file tree Collapse file tree 3 files changed +19
-21
lines changed Original file line number Diff line number Diff line change 66 workflow_dispatch : # allow manual trigger from GitHub UI
77
88jobs :
9- deploy :
10- name : Build, Push, Deploy
9+ publish :
10+ name : Build and Push Image
1111 runs-on : ubuntu-latest
12- # Only deploy after tests and secret scan pass
13- needs : [] # CI runs separately; deploy is triggered by push to main
14- # Enable branch protection to require CI to pass before merge
1512
1613 permissions :
1714 contents : read
3128 uses : docker/build-push-action@v5
3229 with :
3330 context : .
31+ target : production
3432 push : true
3533 tags : |
3634 ghcr.io/hive76/beebot:latest
3735 ghcr.io/hive76/beebot:${{ github.sha }}
38-
39- - name : Deploy to frame.hive76.org
40- uses : appleboy/ssh-action@v1
41- with :
42- host : ${{ secrets.DEPLOY_HOST }}
43- username : ${{ secrets.DEPLOY_USER }}
44- key : ${{ secrets.DEPLOY_SSH_KEY }}
45- script : |
46- cd /opt/beebot
47- docker compose pull
48- docker compose up -d --remove-orphans
49- docker image prune -f
Original file line number Diff line number Diff line change @@ -6,8 +6,9 @@ VERSION := $(shell cat VERSION)
66build :
77 docker build --target production -t beebot:$(VERSION ) -t beebot:latest .
88
9- # # Deploy (or redeploy) the bot container with the latest image
9+ # # Pull latest image from GHCR and redeploy
1010deploy :
11+ docker compose pull beebot
1112 docker compose up -d --force-recreate beebot
1213
1314# # Run a one-off knowledge base sync
Original file line number Diff line number Diff line change 11services :
22 beebot :
3- image : beebot:latest
3+ image : ghcr.io/hive76/ beebot:latest
44 container_name : beebot
55 restart : unless-stopped
66
@@ -30,10 +30,10 @@ services:
3030 start_period : 15s
3131
3232 # Separate sync container — runs once and exits
33- # Trigger manually in Portainer or via cron on host:
33+ # Trigger manually or via cron on host:
3434 # docker compose run --rm beebot-sync
3535 beebot-sync :
36- image : beebot:latest
36+ image : ghcr.io/hive76/ beebot:latest
3737 container_name : beebot-sync
3838 restart : " no"
3939 user : " 0:0" # sync writes to the shared volume; root avoids permission issues
@@ -50,6 +50,17 @@ services:
5050
5151 command : ["python", "sync/sync_docs.py"]
5252
53+ # Watchtower — polls GHCR every 5 minutes, pulls new image, restarts beebot
54+ # Requires: docker login ghcr.io on the host (PAT with read:packages scope)
55+ watchtower :
56+ image : containrrr/watchtower
57+ container_name : watchtower
58+ restart : unless-stopped
59+ volumes :
60+ - /var/run/docker.sock:/var/run/docker.sock
61+ - /root/.docker/config.json:/config.json:ro
62+ command : --interval 300 beebot
63+
5364volumes :
5465 beebot_data :
5566 driver : local
You can’t perform that action at this time.
0 commit comments