More improvements
This commit is contained in:
parent
d87989d51a
commit
8b1754a83e
1 changed files with 23 additions and 1 deletions
24
action.yml
24
action.yml
|
@ -18,6 +18,14 @@ inputs:
|
|||
description: "The Docker Hub token"
|
||||
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:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
@ -34,4 +42,18 @@ runs:
|
|||
if: ${{ inputs.docker_hub_user && inputs.docker_hub_token }}
|
||||
with:
|
||||
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