Skip to content

Commit 0f3f11c

Browse files
Stewart86claude
andcommitted
ci: add automated Docker Hub publishing and update deployment docs
- Add GitHub Actions workflow for automated Docker image publishing - Publish to Docker Hub on every commit to main and version tags - Update README to use pre-built Docker Hub images (1-minute setup) - Add both pre-built and build-from-source deployment options - Include automated publishing documentation and multi-platform support 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 8acae65 commit 0f3f11c

File tree

2 files changed

+120
-28
lines changed

2 files changed

+120
-28
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build and Publish Docker Image
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
env:
11+
REGISTRY: docker.io
12+
IMAGE_NAME: stewart86/bobby-bot
13+
14+
jobs:
15+
build-and-push:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
packages: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Log in to Docker Hub
26+
if: github.event_name != 'pull_request'
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ${{ env.REGISTRY }}
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
33+
- name: Extract metadata (tags, labels) for Docker
34+
id: meta
35+
uses: docker/metadata-action@v5
36+
with:
37+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+
tags: |
39+
type=ref,event=branch
40+
type=ref,event=pr
41+
type=semver,pattern={{version}}
42+
type=semver,pattern={{major}}.{{minor}}
43+
type=raw,value=latest,enable={{is_default_branch}}
44+
45+
- name: Build and push Docker image
46+
uses: docker/build-push-action@v5
47+
with:
48+
context: .
49+
file: ./Dockerfile
50+
push: ${{ github.event_name != 'pull_request' }}
51+
tags: ${{ steps.meta.outputs.tags }}
52+
labels: ${{ steps.meta.outputs.labels }}
53+
platforms: linux/amd64
54+
55+
- name: Update Docker Hub description
56+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
57+
uses: peter-evans/dockerhub-description@v4
58+
with:
59+
username: ${{ secrets.DOCKERHUB_USERNAME }}
60+
password: ${{ secrets.DOCKERHUB_TOKEN }}
61+
repository: ${{ env.IMAGE_NAME }}
62+
readme-filepath: ./README.md

README.md

Lines changed: 58 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,18 @@ Bobby is a Discord chatbot that helps answer questions about your codebase, file
44

55
## Quick Start with Docker
66

7-
Get Bobby running in under 2 minutes:
7+
Get Bobby running in under 1 minute:
88

99
```bash
10-
# 1. Build the Docker image
11-
docker build -t bobby-bot .
12-
13-
# 2. Run Bobby with your credentials
10+
# Run Bobby with your credentials (pre-built image from Docker Hub)
1411
docker run -d \
1512
--name bobby \
1613
-e DISCORD_TOKEN=your_discord_bot_token \
1714
-e ANTHROPIC_API_KEY=your_anthropic_api_key \
1815
-e GH_TOKEN=your_github_personal_access_token \
1916
-e GITHUB_REPO=owner/repo-name \
2017
-v bobby-data:/app/data \
21-
bobby-bot
18+
stewart86/bobby-bot:latest
2219
```
2320

2421
That's it! Bobby will automatically:
@@ -243,26 +240,45 @@ GITHUB_REPO=owner/repo-name
243240
244241
### Docker Deployment
245242
246-
1. Build the Docker image:
243+
**Option 1: Pre-built Image (Recommended)**
247244
248-
```bash
249-
docker build -t bobby-bot .
250-
```
245+
Use the official pre-built image from Docker Hub:
251246
252-
2. Run the container:
247+
```bash
248+
docker run -d \
249+
--name bobby \
250+
-e DISCORD_TOKEN=your_discord_bot_token \
251+
-e ANTHROPIC_API_KEY=your_anthropic_api_key \
252+
-e GH_TOKEN=your_github_personal_access_token \
253+
-e GITHUB_REPO=owner/repo-name \
254+
-e ALLOWED_DISCORD_SERVERS=123456789012345678,987654321098765432 \
255+
-v bobby-data:/app/data \
256+
stewart86/bobby-bot:latest
257+
```
253258
254-
```bash
255-
docker run -d \
256-
--name bobby \
257-
-e DISCORD_TOKEN=your_discord_bot_token \
258-
-e ANTHROPIC_API_KEY=your_anthropic_api_key \
259-
-e GH_TOKEN=your_github_personal_access_token \
260-
-e GITHUB_REPO=owner/repo-name \
261-
-e ALLOWED_DISCORD_SERVERS=123456789012345678,987654321098765432 \
262-
-v bobby-docs:/app/docs \
263-
-v bobby-data:/app/data \
264-
bobby-bot
265-
```
259+
**Option 2: Build from Source**
260+
261+
If you want to build from source or make modifications:
262+
263+
```bash
264+
# 1. Clone the repository
265+
git clone https://github.com/Stewart86/bobby.git
266+
cd bobby
267+
268+
# 2. Build the Docker image
269+
docker build -t bobby-bot .
270+
271+
# 3. Run the container
272+
docker run -d \
273+
--name bobby \
274+
-e DISCORD_TOKEN=your_discord_bot_token \
275+
-e ANTHROPIC_API_KEY=your_anthropic_api_key \
276+
-e GH_TOKEN=your_github_personal_access_token \
277+
-e GITHUB_REPO=owner/repo-name \
278+
-e ALLOWED_DISCORD_SERVERS=123456789012345678,987654321098765432 \
279+
-v bobby-data:/app/data \
280+
bobby-bot
281+
```
266282
267283
The container will automatically authenticate with GitHub using your GH_TOKEN before starting the bot.
268284
@@ -372,16 +388,30 @@ ORG_NAME=$(basename "$1" .env)
372388
docker run -d \
373389
--name "bobby-${ORG_NAME}" \
374390
--env-file "$1" \
375-
-v "bobby-${ORG_NAME}-docs:/app/docs" \
376-
-v "bobby-${ORG_NAME}-db:/app/bobby.sqlite" \
377-
bobby-bot
391+
-v "bobby-${ORG_NAME}-data:/app/data" \
392+
stewart86/bobby-bot:latest
378393
```
379394
380395
This allows each organization to use their own:
381396
382397
- API keys and tokens
383-
- Memory storage (docs/)
384-
- Rate limiting database
398+
- Data storage and session management
399+
400+
## Docker Hub
401+
402+
Bobby is automatically published to Docker Hub with every release:
403+
404+
- **Repository**: [`stewart86/bobby-bot`](https://hub.docker.com/r/stewart86/bobby-bot)
405+
- **Latest stable**: `stewart86/bobby-bot:latest`
406+
- **Specific versions**: `stewart86/bobby-bot:v1.0.0`
407+
408+
### Automated Publishing
409+
410+
GitHub Actions automatically builds and publishes Docker images:
411+
- ✅ **On every commit to main**: Updates `latest` tag
412+
- ✅ **On version tags**: Creates versioned releases (e.g., `v1.0.0`)
413+
- ✅ **Multi-platform support**: Built for `linux/amd64`
414+
- ✅ **Description sync**: README automatically synced to Docker Hub
385415
386416
## Project Structure
387417

0 commit comments

Comments
 (0)