More improvements
This commit is contained in:
parent
d87989d51a
commit
8b1754a83e
1 changed files with 23 additions and 1 deletions
22
action.yml
22
action.yml
|
|
@ -18,6 +18,14 @@ inputs:
|
||||||
description: "The Docker Hub token"
|
description: "The Docker Hub token"
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
cache_from:
|
||||||
|
description: "The cache_from value for docker/build-push-action"
|
||||||
|
value: ${{ steps.helpers.outputs.cache_from }}
|
||||||
|
cache_to:
|
||||||
|
description: "The cache_to value for docker/build-push-action"
|
||||||
|
value: ${{ steps.helpers.outputs.cache_to }}
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -35,3 +43,17 @@ runs:
|
||||||
with:
|
with:
|
||||||
username: ${{ inputs.docker_hub_user }}
|
username: ${{ inputs.docker_hub_user }}
|
||||||
password: ${{ inputs.docker_hub_token }}
|
password: ${{ inputs.docker_hub_token }}
|
||||||
|
- id: helpers
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [[ "${{ github.actor }}" == "nektos/act" ]]; then
|
||||||
|
echo "cache_from=" >> $GITHUB_OUTPUT
|
||||||
|
echo "DOCKER_CACHE_FROM=" >> $GITHUB_ENV
|
||||||
|
echo "cache_to=" >> $GITHUB_OUTPUT
|
||||||
|
echo "DOCKER_CACHE_TO=" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "cache_from=type=gha" >> $GITHUB_OUTPUT
|
||||||
|
echo "DOCKER_CACHE_FROM=type=gha" >> $GITHUB_ENV
|
||||||
|
echo "cache_to=type=gha,mode=max" >> $GITHUB_OUTPUT
|
||||||
|
echo "DOCKER_CACHE_TO=type=gha,mode=max" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue