This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
forked from ChatGPTNextWeb/NextChat
-
Notifications
You must be signed in to change notification settings - Fork 8
125 lines (113 loc) · 4.13 KB
/
docker-without-tag.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#################################################
# Author : @H0llyW00dzZ #
# Note : This Using Github Container #
# Which Pretty useful for GitHub pro plans #
#################################################
name: Publish Docker image (Without Tag Released)
on:
workflow_dispatch:
inputs:
tag_version:
description: 'Enter the tag version for the Docker image'
required: true
description:
description: 'Enter the description for the Docker image'
required: true
build_reverse_proxy:
description: 'Build Go reverse proxy? (yes/no)'
default: 'no'
required: true
go_reverse_proxy_tag:
description: 'Enter the tag for the go-reverse-proxy repository (optional)'
required: false
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
steps:
- # This CI / CD Docker Builder with multi-repo
name: Check out ChatGPT-Next-Web repo
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/ChatGPT-Next-Web
ref: main
-
name: Check out go-reverse-proxy repo
if: ${{ github.event.inputs.build_reverse_proxy == 'yes' }}
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/go-reverse-proxy
ref: master
path: ${{ runner.workspace }}/ChatGPT-Next-Web/go-reverse-proxy
-
name: Copy go sum
if: ${{ github.event.inputs.build_reverse_proxy == 'yes' }}
run: |
cp ${{ runner.workspace }}/ChatGPT-Next-Web/go-reverse-proxy/go.sum ${{ runner.workspace }}/ChatGPT-Next-Web
-
name: Set up Go
if: ${{ github.event.inputs.build_reverse_proxy == 'yes' }}
uses: actions/setup-go@v4
with:
go-version: '1.21.3'
env:
NODE_VERSION: 18
working-directory: ${{ runner.workspace }}/ChatGPT-Next-Web/go-reverse-proxy
-
name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: h0llyw00dzz/chatgpt-next-web
tags: |
type=raw,value=latest
type=ref,event=tag
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- # not ready
name: Build and push Docker image with reverse proxy
if: ${{ github.event.inputs.build_reverse_proxy == 'yes' }}
uses: docker/build-push-action@v4
with:
context: ${{ runner.workspace }}/ChatGPT-Next-Web/go-reverse-proxy
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/h0llyw00dzz/chatgpt-next-web:${{ github.event.inputs.go_reverse_proxy_tag }}
labels: |
${{ steps.meta.outputs.labels }}
org.opencontainers.image.description="${{ github.event.inputs.description }}"
cache-from: type=gha
cache-to: type=gha,mode=max
-
name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/h0llyw00dzz/chatgpt-next-web:${{ github.event.inputs.tag_version }}
ghcr.io/h0llyw00dzz/chatgpt-next-web:latest
labels: |
${{ steps.meta.outputs.labels }}
org.opencontainers.image.description="${{ github.event.inputs.description }}"
cache-from: type=gha
cache-to: type=gha,mode=max
# This ensures the cleanup runs even if the build fails
-
name: Clean up Buildx builder
if: always()
run: docker buildx rm