mirror of
https://github.com/docker/metadata-action.git
synced 2025-06-23 19:27:58 +02:00
Provide outputs as env vars
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
39
.github/workflows/ci.yml
vendored
39
.github/workflows/ci.yml
vendored
@ -37,6 +37,9 @@ jobs:
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
type=sha
|
||||
-
|
||||
name: Print envs
|
||||
run: env|sort
|
||||
|
||||
tag-schedule:
|
||||
runs-on: ubuntu-latest
|
||||
@ -224,6 +227,14 @@ jobs:
|
||||
echo "version=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}"
|
||||
echo "revision=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}"
|
||||
echo "created=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}"
|
||||
-
|
||||
name: JSON build arg
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./test
|
||||
file: ./test/json.Dockerfile
|
||||
build-args: |
|
||||
BUILDINFO=${{ steps.meta.outputs.json }}
|
||||
|
||||
docker-push:
|
||||
runs-on: ubuntu-latest
|
||||
@ -350,3 +361,31 @@ jobs:
|
||||
with:
|
||||
script: |
|
||||
console.log(`${{ steps.meta.outputs.tags }}`);
|
||||
|
||||
output-env:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: ./
|
||||
with:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
labels: |
|
||||
maintainer=CrazyMax
|
||||
-
|
||||
name: Build
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./test
|
||||
file: ./test/output.Dockerfile
|
||||
build-args: |
|
||||
DOCKER_METADATA_OUTPUT_VERSION
|
||||
DOCKER_METADATA_OUTPUT_TAGS
|
||||
DOCKER_METADATA_OUTPUT_LABELS
|
||||
DOCKER_METADATA_OUTPUT_JSON
|
||||
|
Reference in New Issue
Block a user