flow: docker image publish with push and release

This commit is contained in:
SunYuming 2025-02-06 03:11:09 +08:00
parent 28cbe56cec
commit 6bd53cc022
1 changed files with 10 additions and 5 deletions

View File

@ -2,6 +2,9 @@ name: Publish Docker image
on:
workflow_dispatch:
push:
branches:
- main
release:
types: [published]
@ -17,18 +20,20 @@ jobs:
name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: yidadaa/chatgpt-next-web
images: diota/chatgpt-next-web
tags: |
type=raw,value=latest
type=ref,event=tag
${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && 'type=sha,format=short' || '' }}
${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && 'type=raw,value=nightly' || '' }}
${{ (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && 'type=ref,event=tag' || '' }}
${{ (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && 'type=raw,value=stable' || '' }}
-
name: Set up QEMU