Merge branch 'config' into localApps
This commit is contained in:
commit
99830f2a94
|
|
@ -4,42 +4,47 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
repo:
|
repo:
|
||||||
description: '仓库地址'
|
description: 仓库地址
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
ref:
|
ref:
|
||||||
description: '分支名称'
|
description: 分支名称
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
image_name:
|
image_name:
|
||||||
description: '镜像名称'
|
description: 镜像名称
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
image_tag:
|
image_tag:
|
||||||
description: '镜像标签'
|
description: 镜像标签
|
||||||
required: false
|
required: false
|
||||||
default: 'latest'
|
default: latest
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
build_target:
|
dockerfile:
|
||||||
description: '构建目标'
|
description: Dockerfile 在仓库中的路径
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
|
default: Dockerfile
|
||||||
|
|
||||||
architectures:
|
architectures:
|
||||||
description: '构建架构'
|
description: 构建架构
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: "linux/amd64, linux/arm64, linux/arm/v7"
|
default: "linux/amd64, linux/arm64, linux/arm/v7"
|
||||||
|
|
||||||
dockerfile:
|
build_args:
|
||||||
description: 'Dockerfile 在仓库中的路径'
|
description: 以空格分隔的列表,格式为`arg_name=value`,用于定义Dockerfile中指定的构建参数
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
build_target:
|
||||||
|
description: 构建目标
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: 'Dockerfile'
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_DESCRIPTION: Built by GitHub Actions, the associated workflow is https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
IMAGE_DESCRIPTION: Built by GitHub Actions, the associated workflow is https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
|
|
@ -56,13 +61,33 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Confirm current parameters
|
||||||
|
env:
|
||||||
|
REPO_URL: ${{ github.event.inputs.repo }}
|
||||||
|
TARGET_REF: ${{ github.event.inputs.ref }}
|
||||||
|
IMAGE_NAME: ${{ github.event.inputs.image_name }}
|
||||||
|
IMAGE_TAG: ${{ github.event.inputs.image_tag }}
|
||||||
|
DOCKERFILE: ${{ github.event.inputs.dockerfile }}
|
||||||
|
ARCHITECTURES: ${{ github.event.inputs.architectures }}
|
||||||
|
BUILD_ARGS: ${{ github.event.inputs.build_args }}
|
||||||
|
BUILD_TARGET: ${{ github.event.inputs.build_target }}
|
||||||
|
run: |
|
||||||
|
echo "REPO_URL=$REPO_URL"
|
||||||
|
echo "TARGET_REF=$TARGET_REF"
|
||||||
|
echo "IMAGE_NAME=$IMAGE_NAME"
|
||||||
|
echo "IMAGE_TAG=$IMAGE_TAG"
|
||||||
|
echo "DOCKERFILE=$DOCKERFILE"
|
||||||
|
echo "ARCHITECTURES=$ARCHITECTURES"
|
||||||
|
echo "BUILD_ARGS=$BUILD_ARGS"
|
||||||
|
echo "BUILD_TARGET=$BUILD_TARGET"
|
||||||
|
|
||||||
- name: Set env
|
- name: Set env
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME=${{ github.event.inputs.image_name }}
|
IMAGE_NAME: ${{ github.event.inputs.image_name }}
|
||||||
run: |
|
run: |
|
||||||
owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')
|
owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')
|
||||||
echo "OWNER=$owner" >> "$GITHUB_ENV"
|
echo "OWNER=$owner" >> "$GITHUB_ENV"
|
||||||
echo "IMAGE_FULL_NAME=ghcr.io/${{ env.OWNER }}/$IMAGE_NAME" >> $GITHUB_ENV
|
echo "IMAGE_FULL_NAME=ghcr.io/$owner/$IMAGE_NAME" >> $GITHUB_ENV
|
||||||
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
|
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
|
||||||
echo "IMAGE_TAG=${{ github.event.inputs.image_tag }}" >> $GITHUB_ENV
|
echo "IMAGE_TAG=${{ github.event.inputs.image_tag }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
|
@ -135,6 +160,8 @@ jobs:
|
||||||
id: push
|
id: push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
|
build-args: |
|
||||||
|
${{ github.event.inputs.repo }}
|
||||||
context: .
|
context: .
|
||||||
target: ${{ github.event.inputs.build_target }}
|
target: ${{ github.event.inputs.build_target }}
|
||||||
push: true
|
push: true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue