File tree Expand file tree Collapse file tree 4 files changed +52
-5
lines changed Expand file tree Collapse file tree 4 files changed +52
-5
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Image
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+
7+ jobs :
8+ build-and-push :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout repository
12+ uses : actions/checkout@v4
13+
14+ - name : Set up QEMU
15+ uses : docker/setup-qemu-action@v3
16+
17+ - name : Set up Docker Buildx
18+ uses : docker/setup-buildx-action@v3
19+
20+ - name : Login to Docker Hub
21+ uses : docker/login-action@v3
22+ with :
23+ username : ${{ secrets.DOCKERHUB_USERNAME }}
24+ password : ${{ secrets.DOCKERHUB_TOKEN }}
25+
26+ - name : Build and push
27+ uses : docker/build-push-action@v5
28+ with :
29+ context : .
30+ push : true
31+ tags : 006lp/akashchat-api-go:latest
Original file line number Diff line number Diff line change 11# Build stage
2- FROM golang:1.21 -alpine AS builder
2+ FROM golang:1.24 -alpine AS builder
33
44# Set working directory
55WORKDIR /app
Original file line number Diff line number Diff line change @@ -46,14 +46,22 @@ go run cmd/server/main.go
4646
4747### 使用 Docker
4848
49+ #### 从 Docker Hub 拉取镜像
50+
51+ ``` bash
52+ docker pull 006lp/akashchat-api-go:latest
53+ ```
54+
55+ #### 本地构建
56+
49571 . 构建 Docker 镜像:
5058``` bash
51- docker build -t akashchat-api-go .
59+ docker build -t 006lp/ akashchat-api-go .
5260```
5361
54622 . 运行容器:
5563``` bash
56- docker run -p 16571:16571 akashchat-api-go
64+ docker run -p 16571:16571 006lp/ akashchat-api-go
5765```
5866
5967## API 使用
Original file line number Diff line number Diff line change @@ -46,14 +46,22 @@ The server will start on `localhost:16571` by default.
4646
4747### Using Docker
4848
49+ #### Pull from Docker Hub
50+
51+ ``` bash
52+ docker pull 006lp/akashchat-api-go:latest
53+ ```
54+
55+ #### Build Locally
56+
49571 . Build the Docker image:
5058``` bash
51- docker build -t akashchat-api-go .
59+ docker build -t 006lp/ akashchat-api-go .
5260```
5361
54622 . Run the container:
5563``` bash
56- docker run -p 16571:16571 akashchat-api-go
64+ docker run -p 16571:16571 006lp/ akashchat-api-go
5765```
5866
5967## API Usage
You can’t perform that action at this time.
0 commit comments