Skip to content

release: v0.4.0-alpha8 (Support GPT-4 All tools) #103

release: v0.4.0-alpha8 (Support GPT-4 All tools)

release: v0.4.0-alpha8 (Support GPT-4 All tools) #103

Workflow file for this run

name: Build and publish Docker image
on:
push:
tags: ["v*"]
branches: ["test-workflow"]
workflow_dispatch:
inputs:
version:
description: "Version tag for the Docker image (semver)"
required: true
env:
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Clone ChatGPT-Proxy-V4
run: git clone https://github.com/moeakwak/ChatGPT-Proxy-V4.git
# - name: Setup Go
# uses: actions/setup-go@v4
# with:
# go-version: "1.20"
# cache-dependency-path: ChatGPT-Proxy-V4/go.sum
# - name: build ChatGPT-Proxy-V4
# run: |
# cd ChatGPT-Proxy-V4
# go build
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ env.IMAGE_NAME }}
${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}${{ github.event_name == 'workflow_dispatch' && format(',value={0}', github.event.inputs.version) || '' }}
type=semver,pattern={{major}}.{{minor}}${{ github.event_name == 'workflow_dispatch' && format(',value={0}', github.event.inputs.version) || '' }}
# - name: Create Sentry release
# uses: getsentry/action-release@v1
# env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
# SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
# # SENTRY_URL: https://sentry.io/
# with:
# environment: production
# sourcemaps: frontend/dist/assets
# version: ${{ github.ref }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Dockerhub
uses: docker/login-action@v2
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max