Skip to content

Commit e79b8b1

Browse files
authored
Linbee 6728 add option to run GitHub action with cache (#62)
* set mishaTest tag and formatting * fix docker run line * add tag to docker * add coker cache * Add pull_docker_from_cache input to action.yml * Add gitstream directory * Fix if condition in action.yml * Fix if condition in action.yml * Fix if condition in action.yml * Fix if condition in action.yml * Fix if condition in action.yml * Fix if condition in action.yml * Fix if condition in action.yml * Fix if condition in action.yml * Fix if condition in action.yml * Update default value for pull_docker_from_cache * Update action.yml with descriptive quotes * revert format * revert format * Update default value for pull_docker_from_cache for false * Update action.yml with new versions of actions/checkout and actions/github-script * Update action.yml with new default value for pull_docker_from_cache * Update action.yml to remove docker pull command * Check Docker Rate Limits * Check Docker Rate Limits * remove Check Docker Rate Limits
1 parent 4cc085a commit e79b8b1

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

action.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ inputs:
2525
debug_mode:
2626
description: "Run parser in debug mode"
2727
required: false
28-
default: false
28+
default: "false"
29+
pull_docker_from_cache:
30+
description: "If should store gitstream docker in GitHub cache"
31+
required: false
32+
default: "false"
2933
runs:
3034
using: "composite"
3135
steps:
@@ -100,6 +104,17 @@ runs:
100104
ref: ${{ fromJSON(fromJSON(github.event.inputs.client_payload)).cmRepoRef }}
101105
path: "gitstream/cm/"
102106

107+
- name: Docker Layer Caching
108+
if: ${{ inputs.pull_docker_from_cache == 'true' }}
109+
uses: satackey/action-docker-layer-caching@v0.0.11
110+
continue-on-error: true
111+
with:
112+
concurrency: 12
113+
114+
- name: Pull gitstream Docker
115+
shell: bash
116+
run: docker pull gitstream/rules-engine:latest
117+
103118
- name: Run The Action
104119
if: always()
105120
run: |
@@ -109,7 +124,6 @@ runs:
109124
value="${!var}"
110125
echo "$var=$value" >> "$env_file"
111126
done
112-
docker pull gitstream/rules-engine:latest
113127
docker run --env-file $env_file \
114128
-v $(pwd)/gitstream:/code \
115129
-e HEAD_REF=$'upstream/${{ steps.safe-strings.outputs.head_ref }}' \

0 commit comments

Comments
 (0)