update workflow

This commit is contained in:
2026-03-09 10:35:37 +08:00
parent d401ebb208
commit aba7a4c8fc
3 changed files with 142 additions and 10 deletions

View File

@@ -3,18 +3,20 @@ name: Publish Docker to GHCR
on:
workflow_dispatch:
inputs:
environment:
description: "Target environment"
stack_env:
description: "stack env"
required: true
type: choice
default: "development"
default: "dev"
options:
- development
- production
- staging
- dev
- prod
- stg
tag:
description: "Image tag (e.g. v1.0.0)"
description: "Image tag (e.g. 1.0.0)"
required: true
default: "1.0.0"
env:
REGISTRY: ghcr.io
@@ -22,7 +24,7 @@ env:
jobs:
publish:
name: Build & Push to GHCR (${{ github.event.inputs.environment }})
name: Build & Push to GHCR ${{ github.repository }}:${{ github.event.inputs.stack_env }}-${{ github.event.inputs.tag }}
runs-on: ubuntu-latest
permissions:
contents: read
@@ -59,8 +61,8 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ github.event.inputs.environment }}-${{ github.event.inputs.tag }}
type=raw,value=${{ github.event.inputs.environment }}-latest
type=raw,value=${{ github.event.inputs.stack_env }}-${{ github.event.inputs.tag }}
type=raw,value=${{ github.event.inputs.stack_env }}-latest
- name: Build and push Docker image
uses: docker/build-push-action@v6