Provide outputs as env vars

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-01-13 10:45:14 +01:00
parent 05d22bf317
commit 6729545cde
5 changed files with 84 additions and 5 deletions

View File

@ -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