Skip to content

Commit d8aaf6d

Browse files
author
Kirill Turanskiy
committed
Merge pull request RayBytes#82 from liznear/main
Add github action to push docker image
2 parents f340d74 + a0149e0 commit d8aaf6d

3 files changed

Lines changed: 66 additions & 4 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*"
9+
pull_request:
10+
branches:
11+
- main
12+
workflow_dispatch:
13+
14+
env:
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: ${{ github.repository }}
17+
18+
jobs:
19+
build-and-push:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v3
33+
34+
- name: Extract Docker metadata
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39+
tags: |
40+
type=ref,event=branch
41+
type=ref,event=tag
42+
type=sha
43+
44+
- name: Log in to registry
45+
if: github.event_name != 'pull_request'
46+
uses: docker/login-action@v3
47+
with:
48+
registry: ${{ env.REGISTRY }}
49+
username: ${{ github.actor }}
50+
password: ${{ secrets.GITHUB_TOKEN }}
51+
52+
- name: Build and push Docker image
53+
uses: docker/build-push-action@v5
54+
with:
55+
context: .
56+
file: ./Dockerfile
57+
platforms: linux/amd64,linux/arm64
58+
push: ${{ github.event_name != 'pull_request' }}
59+
tags: ${{ steps.meta.outputs.tags }}
60+
labels: ${{ steps.meta.outputs.labels }}

Formula/chatmock.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ class Chatmock < Formula
33

44
desc "OpenAI & Ollama compatible API powered by your ChatGPT plan"
55
homepage "https://github.com/RayBytes/ChatMock"
6-
url "https://github.com/RayBytes/ChatMock/archive/refs/tags/v1.3.tar.gz"
7-
sha256 "9bb1a839f84e277ccd4233a7a0024759d9e2e60c9881ed1e20b57cd1b12033b4"
6+
url "https://github.com/RayBytes/ChatMock/archive/refs/tags/v1.35.tar.gz"
7+
sha256 "0f710e100d325effe0cd927845e40bbc98aa7d20e6c3eefb87428c876b2168bf"
88
license "MIT"
99
head "https://github.com/RayBytes/ChatMock.git", branch: "main"
1010

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ docker-compose -f docker-compose.traefik.yml up -d
121121

122122
📖 **[Complete Docker Documentation](./docs/DOCKER.md)** | 🚀 **[Production Guide](./docs/PRODUCTION.md)** | 🔒 **[Traefik Setup](./docs/TRAEFIK.md)**
123123

124+
## Continuous Integration
125+
126+
Every push or pull request to `main` runs the workflow at `.github/workflows/docker-image.yml`, which builds multi-arch (linux/amd64 + linux/arm64) Docker images and (on pushes) publishes them to GitHub's container registry using the built-in `GITHUB_TOKEN`. The image is tagged for the branch, tag, and commit SHA, so you can pull `ghcr.io/<your-org-or-user>/ChatMock:main` (or whatever tag was built) directly after CI completes. If you prefer Docker Hub or another registry, update the `REGISTRY` or `IMAGE_NAME` env vars in the workflow file accordingly.
127+
124128
# Examples
125129

126130
### Python
@@ -473,5 +477,3 @@ For more help, check the [documentation](./docs/README.md) or [open an issue](ht
473477
[![Star History Chart](https://api.star-history.com/svg?repos=RayBytes/ChatMock&type=Timeline)](https://www.star-history.com/#RayBytes/ChatMock&Timeline)
474478

475479

476-
477-

0 commit comments

Comments
 (0)