mirror of
https://github.com/stulzq/azure-openai-proxy.git
synced 2025-12-24 01:34:27 +01:00
chore: build image wf add trigger push tag
This commit is contained in:
17
.github/workflows/docker.yml
vendored
17
.github/workflows/docker.yml
vendored
@@ -3,10 +3,13 @@ name: Build Image
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tags:
|
||||
tag:
|
||||
default: 'latest'
|
||||
required: true
|
||||
description: 'Docker image tag'
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
@@ -30,6 +33,14 @@ jobs:
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Parse Tag Name
|
||||
run: |
|
||||
if [ x${{ github.event.inputs.tag }} == x"" ]; then
|
||||
echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||
else
|
||||
echo "TAG_NAME=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
@@ -40,8 +51,8 @@ jobs:
|
||||
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
|
||||
org.opencontainers.image.licenses=Apache-2.0
|
||||
tags: |
|
||||
${{ github.repository }}:${{ github.event.inputs.tags }}
|
||||
ghcr.io/${{ github.repository }}:${{ github.event.inputs.tags }}
|
||||
${{ github.repository }}:${{ env.TAG_NAME }}
|
||||
ghcr.io/${{ github.repository }}:${{ env.TAG_NAME }}
|
||||
# https://docs.docker.com/build/cache/backends/gha/
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
Reference in New Issue
Block a user