Skip to content

Commit a24af8f

Browse files
authored
Add Docker Hub publish workflow and switch Railway to pull pre-built image (#46)
- Add GitHub Actions workflow to build multi-arch images (amd64+arm64) and push to helpcodeai/anythingmcp on Docker Hub - Switch Railway config from Dockerfile builder to DOCKERIMAGE, pulling the pre-built image from Docker Hub instead of rebuilding - Add Docker Hub image reference in docker-compose.yml for self-hosters - Support semver tags (v*) and latest on push to main
1 parent 0f29f26 commit a24af8f

4 files changed

Lines changed: 68 additions & 9 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish Docker Image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ["v*"]
7+
workflow_dispatch:
8+
9+
defaults:
10+
run:
11+
working-directory: anythingmcp
12+
13+
jobs:
14+
publish:
15+
name: Build & Push to Docker Hub
16+
runs-on: ubuntu-latest
17+
18+
permissions:
19+
contents: read
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Log in to Docker Hub
28+
uses: docker/login-action@v3
29+
with:
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
33+
- name: Extract metadata (tags, labels)
34+
id: meta
35+
uses: docker/metadata-action@v5
36+
with:
37+
images: helpcodeai/anythingmcp
38+
tags: |
39+
# "latest" on every push to main
40+
type=raw,value=latest,enable={{is_default_branch}}
41+
# semver tags: v1.2.3 → 1.2.3, 1.2, 1
42+
type=semver,pattern={{version}}
43+
type=semver,pattern={{major}}.{{minor}}
44+
# short SHA for traceability
45+
type=sha,prefix=
46+
47+
- name: Build and push
48+
uses: docker/build-push-action@v6
49+
with:
50+
context: anythingmcp
51+
push: true
52+
platforms: linux/amd64,linux/arm64
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+
cache-from: type=gha
56+
cache-to: type=gha,mode=max
57+
58+
- name: Trigger Railway redeploy
59+
if: env.RAILWAY_WEBHOOK_URL != ''
60+
env:
61+
RAILWAY_WEBHOOK_URL: ${{ secrets.RAILWAY_WEBHOOK_URL }}
62+
run: curl -fsSL -X POST "$RAILWAY_WEBHOOK_URL"

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ services:
3131

3232
# NestJS Backend + Next.js Frontend (single container)
3333
app:
34+
image: helpcodeai/anythingmcp:latest
3435
build:
3536
context: .
3637
dockerfile: Dockerfile

railway.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"$schema": "https://railway.com/railway.schema.json",
33
"build": {
4-
"builder": "DOCKERFILE",
5-
"dockerfilePath": "Dockerfile"
4+
"builder": "DOCKERIMAGE",
5+
"dockerImage": "helpcodeai/anythingmcp:latest"
66
},
77
"deploy": {
88
"startCommand": "./start.sh",
@@ -18,11 +18,7 @@
1818
"description": "AnythingMCP — NestJS Backend + Next.js Frontend",
1919
"icon": "https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/packages/frontend/public/logo.svg",
2020
"source": {
21-
"repo": "HelpCode-ai/anythingmcp"
22-
},
23-
"build": {
24-
"builder": "DOCKERFILE",
25-
"dockerfilePath": "Dockerfile"
21+
"image": "helpcodeai/anythingmcp:latest"
2622
},
2723
"deploy": {
2824
"startCommand": "./start.sh",

railway.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# =============================================================================
77

88
[build]
9-
builder = "DOCKERFILE"
10-
dockerfilePath = "Dockerfile"
9+
builder = "DOCKERIMAGE"
10+
dockerImage = "helpcodeai/anythingmcp:latest"
1111

1212
[deploy]
1313
startCommand = "./start.sh"

0 commit comments

Comments
 (0)