Skip to content

Commit 25e5f72

Browse files
canyugsclaude
andcommitted
ci: add Docker Hub build and push workflow
GitHub Actions workflow triggered on push to main or version tags. Builds and pushes zeabur/rag-service image with layer caching. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 55d2b6a commit 25e5f72

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ["v*"]
7+
workflow_dispatch:
8+
9+
env:
10+
IMAGE_NAME: zeabur/rag-service
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: docker/setup-buildx-action@v3
23+
24+
- name: Login to Docker Hub
25+
uses: docker/login-action@v3
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_TOKEN }}
29+
30+
- name: Docker metadata
31+
id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: ${{ env.IMAGE_NAME }}
35+
tags: |
36+
type=raw,value=latest,enable={{is_default_branch}}
37+
type=semver,pattern={{version}}
38+
type=semver,pattern={{major}}.{{minor}}
39+
type=sha,prefix=
40+
41+
- name: Build and push
42+
uses: docker/build-push-action@v6
43+
with:
44+
context: .
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max

TODO.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# TODO
2+
3+
## Deployment
4+
5+
- [ ] Create GitHub repo `zeabur/rag-service`
6+
- [ ] Add Docker Hub secrets to repo settings:
7+
- `DOCKERHUB_USERNAME`
8+
- `DOCKERHUB_TOKEN`
9+
- [ ] Push code and verify GitHub Actions builds + pushes `zeabur/rag-service:latest`
10+
- [ ] Publish Zeabur template to marketplace

0 commit comments

Comments
 (0)