Skip to content

Commit

Permalink
Merge pull request #179 from signalwire/feat/custom-docker-caching
Browse files Browse the repository at this point in the history
configure docker caching
  • Loading branch information
lucasmellos authored Dec 20, 2023
2 parents 7cfabe7 + 9a90605 commit 2e75696
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
12 changes: 10 additions & 2 deletions .github/actions/docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ inputs:
default: 'false'
description: 'Generate tag only.'
required: false
CACHE_FROM:
default: 'type=gha'
description: 'Cache from.'
required: false
CACHE_TO:
default: 'type=gha,mode=max'
description: 'Cache to.'
required: false
outputs:
IMAGE_TAG:
description: "Export image tag"
Expand Down Expand Up @@ -150,8 +158,8 @@ runs:
push: true
tags: |
${{ steps.meta.outputs.tags }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
cache-from: ${{ inputs.CACHE_FROM }}
cache-to: ${{ inputs.CACHE_TO }}}
file: ${{ inputs.FILE }}
context: ${{ inputs.CONTEXT }}
platforms: ${{ inputs.PLATFORMS }}
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ on:
type: string
description: ref to pull and build default to github.ref
required: false
CACHE_FROM:
type: string
default: 'type=gha'
description: 'Cache from.'
required: false
CACHE_TO:
type: string
default: 'type=gha,mode=max'
description: 'Cache to.'
required: false
secrets:
DOCKERHUB_USERNAME:
required: false
Expand Down Expand Up @@ -130,7 +140,6 @@ on:
BUILD_ARGS:
required: false
description: Whenever we wanna use secrets and mount them as env

outputs:
IMAGE_TAG:
value: ${{ jobs.build.outputs.IMAGE_TAG }}
Expand Down Expand Up @@ -226,6 +235,8 @@ jobs:
CONTAINER_TEST: ${{ inputs.CONTAINER_TEST }}
CONTAINER_TEST_COMMAND: ${{ inputs.CONTAINER_TEST_COMMAND }}
OUTPUT_TAG_INDEX: ${{ inputs.OUTPUT_TAG_INDEX }}
CACHE_FROM: ${{ inputs.CACHE_FROM }}
CACHE_TO: ${{ inputs.CACHE_TO }}
env:
GITHUB_TOKEN: ${{ github.token }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down

0 comments on commit 2e75696

Please sign in to comment.