mirror of
https://github.com/yanhao98/composite-actions.git
synced 2025-07-13 23:00:48 +08:00
测试 docker-build-push@main 的 构建
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -22,6 +22,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
login_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
login_username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
login_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
login_password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
build_push: false
|
||||||
|
build_file: ./docker-build-push/Dockerfile
|
||||||
# - name: Check Docker image
|
# - name: Check Docker image
|
||||||
# run: |
|
# run: |
|
||||||
# set -x
|
# set -x
|
||||||
|
1
docker-build-push/Dockerfile
Normal file
1
docker-build-push/Dockerfile
Normal file
@ -0,0 +1 @@
|
|||||||
|
FROM alpine:latest
|
@ -4,13 +4,29 @@ inputs:
|
|||||||
login_repository:
|
login_repository:
|
||||||
description: "docker/login-action 的 registry 参数"
|
description: "docker/login-action 的 registry 参数"
|
||||||
default: "docker.io"
|
default: "docker.io"
|
||||||
required: true
|
required: false
|
||||||
login_username:
|
login_username:
|
||||||
description: "docker/login-action 的 username 参数"
|
description: "docker/login-action 的 username 参数"
|
||||||
required: true
|
required: true
|
||||||
login_password:
|
login_password:
|
||||||
description: "docker/login-action 的 password 参数"
|
description: "docker/login-action 的 password 参数"
|
||||||
required: true
|
required: true
|
||||||
|
build_file:
|
||||||
|
description: "Dockerfile 文件路径"
|
||||||
|
default: "./Dockerfile"
|
||||||
|
required: false
|
||||||
|
build_context:
|
||||||
|
description: "Docker 构建上下文路径"
|
||||||
|
default: "."
|
||||||
|
required: false
|
||||||
|
build_platforms:
|
||||||
|
description: "Docker 构建平台"
|
||||||
|
default: "linux/amd64,linux/arm64"
|
||||||
|
required: false
|
||||||
|
build_push:
|
||||||
|
description: "是否推送 Docker 镜像"
|
||||||
|
default: "true"
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
@ -31,11 +47,11 @@ runs:
|
|||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
file: ${{ inputs.build_file }}
|
||||||
platforms: linux/amd64,linux/arm64
|
context: ${{ inputs.build_context }}
|
||||||
push: true
|
platforms: ${{ inputs.build_platforms }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
push: ${{ inputs.build_push }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
# tags: ${{ steps.meta.outputs.tags }}
|
||||||
file: ./Dockerfile
|
# labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
Reference in New Issue
Block a user