Skip to content

Commit

Permalink
Update New Main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
spammenotinoz authored Feb 8, 2024
1 parent 33a2982 commit 187dfc9
Showing 1 changed file with 19 additions and 24 deletions.
43 changes: 19 additions & 24 deletions .github/workflows/New Main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Build and publish Docker image Spam
name: Build and publish Docker image SPAM

on:
push:
tags: ["v*"]
branches: ["test-workflow"]
workflow_dispatch:
inputs:
version:
Expand All @@ -12,9 +11,10 @@ on:

env:
IMAGE_NAME: ${{ github.repository }}
VERSION: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version || github.ref_name }}

jobs:
build-and-push-image:
build-and-push-x64-image:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -24,30 +24,16 @@ jobs:
- 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:
Expand All @@ -69,12 +55,6 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to Dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
Expand All @@ -86,3 +66,18 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

create-release:
runs-on: ubuntu-latest
needs: build-and-push-x64-image
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}
prerelease: ${{ contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta') }}
generate_release_notes: true

0 comments on commit 187dfc9

Please sign in to comment.