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