Skip to content

Commit f4e88a4

Browse files
author
Kees 🧀
committed
ci: add Docker Hub publish workflow + fix Dockerfile deps
- .github/workflows/docker-publish.yml: new workflow that builds and pushes Docker images to Docker Hub on every push to main and on version tags (v*.*.*) - Builds robinwaslander/kanbu-api and robinwaslander/kanbu-web in parallel (fail-fast: false) - Tags: latest (main branch) + semver (v1.2.3 and v1.2) - GitHub Actions layer cache (type=gha) for fast incremental builds - Uses docker/build-push-action@v6 with BuildKit - docker/Dockerfile.api: add packages/openclaw-bridge/package.json to deps stage (was missing, caused pnpm workspace resolution failure) - docker/Dockerfile.web: same fix Requires GitHub repository secrets: DOCKERHUB_USERNAME = robinwaslander DOCKERHUB_TOKEN = Docker Hub PAT with Read/Write/Delete
1 parent cd474f9 commit f4e88a4

3 files changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Docker Publish
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ['v*.*.*']
7+
8+
jobs:
9+
docker:
10+
name: Build & Push (${{ matrix.service }})
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- service: api
20+
dockerfile: docker/Dockerfile.api
21+
image: robinwaslander/kanbu-api
22+
- service: web
23+
dockerfile: docker/Dockerfile.web
24+
image: robinwaslander/kanbu-web
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v3
32+
33+
- name: Log in to Docker Hub
34+
uses: docker/login-action@v3
35+
with:
36+
username: ${{ secrets.DOCKERHUB_USERNAME }}
37+
password: ${{ secrets.DOCKERHUB_TOKEN }}
38+
39+
- name: Extract metadata (tags & labels)
40+
id: meta
41+
uses: docker/metadata-action@v5
42+
with:
43+
images: ${{ matrix.image }}
44+
tags: |
45+
type=semver,pattern={{version}}
46+
type=semver,pattern={{major}}.{{minor}}
47+
type=raw,value=latest,enable={{is_default_branch}}
48+
49+
- name: Build and push
50+
uses: docker/build-push-action@v6
51+
with:
52+
context: .
53+
file: ${{ matrix.dockerfile }}
54+
push: true
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}
57+
cache-from: type=gha,scope=${{ matrix.service }}
58+
cache-to: type=gha,mode=max,scope=${{ matrix.service }}

docker/Dockerfile.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
1515
COPY apps/api/package.json ./apps/api/
1616
COPY apps/web/package.json ./apps/web/
1717
COPY packages/shared/package.json ./packages/shared/
18+
COPY packages/openclaw-bridge/package.json ./packages/openclaw-bridge/
1819
COPY packages/cli/package.json ./packages/cli/
1920
COPY packages/git-hooks/package.json ./packages/git-hooks/
2021
COPY packages/mcp-server/package.json ./packages/mcp-server/

docker/Dockerfile.web

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
1414
COPY apps/web/package.json ./apps/web/
1515
COPY apps/api/package.json ./apps/api/
1616
COPY packages/shared/package.json ./packages/shared/
17+
COPY packages/openclaw-bridge/package.json ./packages/openclaw-bridge/
1718
COPY packages/cli/package.json ./packages/cli/
1819
COPY packages/git-hooks/package.json ./packages/git-hooks/
1920
COPY packages/mcp-server/package.json ./packages/mcp-server/

0 commit comments

Comments
 (0)