mirror of
https://github.com/yanhao98/composite-actions.git
synced 2025-07-13 23:00:48 +08:00
测试 docker/metadata-action
This commit is contained in:
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@ -27,7 +27,12 @@ jobs:
|
|||||||
build_push: false
|
build_push: false
|
||||||
build_load: true
|
build_load: true
|
||||||
build_tags: image-test
|
build_tags: image-test
|
||||||
|
metadata_images: |
|
||||||
|
docker.io/murielmay67761/docker-example
|
||||||
|
metadata_tags: |
|
||||||
|
type=raw,value=latest
|
||||||
- name: Check Docker image
|
- name: Check Docker image
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x;
|
||||||
docker run --rm image-test:latest whoami
|
# docker run --rm image-test:latest whoami
|
||||||
|
docker images;
|
||||||
|
@ -31,8 +31,11 @@ inputs:
|
|||||||
description: "是否加载 Docker 镜像"
|
description: "是否加载 Docker 镜像"
|
||||||
default: "false"
|
default: "false"
|
||||||
required: false
|
required: false
|
||||||
build_tags:
|
metadata_images:
|
||||||
description: "Docker 镜像标签"
|
description: "docker/metadata-action 的 images 参数"
|
||||||
|
required: false
|
||||||
|
metadata_tags:
|
||||||
|
description: "docker/metadata-action 的 tags 参数"
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
@ -41,6 +44,12 @@ runs:
|
|||||||
with:
|
with:
|
||||||
filter: blob:none
|
filter: blob:none
|
||||||
show-progress: false
|
show-progress: false
|
||||||
|
- name: Extract metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ${{ inputs.metadata_images }}
|
||||||
|
tags: ${{ inputs.metadata_tags }}
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@ -59,9 +68,9 @@ runs:
|
|||||||
platforms: ${{ inputs.build_platforms }}
|
platforms: ${{ inputs.build_platforms }}
|
||||||
push: ${{ inputs.build_push }}
|
push: ${{ inputs.build_push }}
|
||||||
load: ${{ inputs.build_load }}
|
load: ${{ inputs.build_load }}
|
||||||
tags: ${{ inputs.build_tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
# labels: ${{ steps.meta.outputs.labels }}
|
# labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
# 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