Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
Refactor CI / CD Docker Builder
Browse files Browse the repository at this point in the history
[+] fix(docker-without-tag.yml): update path for go-reverse-proxy in the checkout step
[+] feat(docker-without-tag.yml): add support for working directory in the Go setup step
[+] feat(docker-without-tag.yml): build and push Docker image with go reverse proxy
[+] feat(docker-without-tag.yml): build and push Docker image without reverse proxy
  • Loading branch information
H0llyW00dzZ committed Nov 13, 2023
1 parent 5190f60 commit 6543793
Showing 1 changed file with 26 additions and 29 deletions.
55 changes: 26 additions & 29 deletions .github/workflows/docker-without-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
with:
repository: ${{ github.repository_owner }}/go-reverse-proxy
ref: master
path: go-reverse-proxy
path: ChatGPT-Next-Web/go-reverse-proxy

-
name: Set up Go
Expand All @@ -55,6 +55,7 @@ jobs:
go-version: '1.21.3'
env:
NODE_VERSION: 18
working-directory: ChatGPT-Next-Web/go-reverse-proxy
-
name: Log in to GitHub Container Registry
uses: docker/login-action@v2
Expand Down Expand Up @@ -84,32 +85,28 @@ jobs:
-
name: Build and push Docker image with reverse proxy
if: ${{ github.event.inputs.build_reverse_proxy == 'yes' }}
run: |
docker buildx create --use
docker buildx build -t ghcr.io/h0llyw00dzz/chatgpt-next-web:${{ github.event.inputs.tag_version }} \
--build-arg BUILD_REVERSE_PROXY=${{ github.event.inputs.build_reverse_proxy == 'yes' }} \
--build-arg GO_REVERSE_PROXY_TAG=${{ github.event.inputs.go_reverse_proxy_tag }} \
--label "version=${{ github.event.inputs.tag_version }}" \
--label "description=${{ github.event.inputs.description }}" \
--cache-from type=gha \
--cache-to type=gha,mode=max \
--platform linux/amd64,linux/arm64 \
-f ./ChatGPT-Next-Web/Dockerfile \
./ChatGPT-Next-Web \
-f ./go-reverse-proxy/Dockerfile \
./go-reverse-proxy
docker push ghcr.io/h0llyw00dzz/chatgpt-next-web:${{ github.event.inputs.tag_version }}
uses: docker/build-push-action@v4
with:
context: ./ChatGPT-Next-Web/go-reverse-proxy/DockerFiles
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 without reverse proxy
if: ${{ github.event.inputs.build_reverse_proxy == 'no' }}
run: |
docker buildx create --use
docker buildx build -t ghcr.io/h0llyw00dzz/chatgpt-next-web:${{ github.event.inputs.tag_version }} \
--label "version=${{ github.event.inputs.tag_version }}" \
--label "description=${{ github.event.inputs.description }}" \
--cache-from type=gha \
--cache-to type=gha,mode=max \
--platform linux/amd64,linux/arm64 \
./ChatGPT-Next-Web
docker push ghcr.io/h0llyw00dzz/chatgpt-next-web:${{ github.event.inputs.tag_version }}
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 }}
labels: |
${{ steps.meta.outputs.labels }}
org.opencontainers.image.description="${{ github.event.inputs.description }}"
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 6543793

Please sign in to comment.