This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 1111
1212env :
1313 GHCR_REPO : ghcr.io/leafmoes/ddg-chat
14+ DOCKER_HUB_REPO : leafmoes/ddg-chat
1415
1516jobs :
1617 docker :
3132 registry : ghcr.io
3233 username : ${{ github.repository_owner }}
3334 password : ${{ secrets.GHCR_PAT }}
35+
36+ - name : Login to Docker Hub
37+ uses : docker/login-action@v2
38+ with :
39+ username : ${{ secrets.DOCKERHUB_USERNAME }}
40+ password : ${{ secrets.DOCKERHUB_PASSWORD }}
41+
42+ - name : Get short SHA
43+ id : slug
44+ run : echo "::set-output name=sha7::$(echo ${GITHUB_SHA} | cut -c1-7)"
3445
35- - name : Build and push
46+ - name : Build and push to GitHub Container Registry
3647 uses : docker/build-push-action@v6
3748 with :
3849 context : .
4152 push : true
4253 tags : |
4354 ${{ env.GHCR_REPO }}:latest
44- ${{ env.GHCR_REPO }}:${{ github.sha }}
55+ ${{ env.GHCR_REPO }}:${{ steps.slug.outputs.sha7 }}
56+ cache-from : type=gha
57+ cache-to : type=gha,mode=max
58+
59+ - name : Build and push to Docker Hub
60+ uses : docker/build-push-action@v6
61+ with :
62+ context : .
63+ platforms : linux/amd64,linux/arm64
64+ file : Dockerfile
65+ push : true
66+ tags : |
67+ ${{ env.DOCKER_HUB_REPO }}:lates1314521t
68+ ${{ env.DOCKER_HUB_REPO }}:${{ steps.slug.outputs.sha7 }}
4569 cache-from : type=gha
4670 cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ version: '3'
22
33services :
44 ddg-chat :
5- image : ghcr.io/ leafmoes/ddg-chat:latest
5+ image : leafmoes/ddg-chat:latest
66 container_name : ddg-chat
77 restart : unless-stopped
88 ports :
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ npm install
130130
131131方法一:命令行构建
132132``` bash
133- docker run -it -d --name ddg-chat -p 8787:8787 ghcr.io/ leafmoes/ddg-chat:latest
133+ docker run -it -d --name ddg-chat -p 8787:8787 leafmoes/ddg-chat:latest
134134```
135135
136136方法二:使用 ` docker-compose.yml ` 文件构建
You can’t perform that action at this time.
0 commit comments