Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure docker caching #179

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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