File tree Expand file tree Collapse file tree 5 files changed +48
-5
lines changed Expand file tree Collapse file tree 5 files changed +48
-5
lines changed Original file line number Diff line number Diff line change 3939
4040 steps :
4141 - uses : actions/checkout@v2
42+ - run : docker-compose -f test_project/docker-compose.yml -p test_project pull
4243
4344 - name : Extract
4445 id : extract
6667
6768 steps :
6869 - uses : actions/checkout@v2
70+ - run : docker-compose -f test_project/docker-compose.yml -p test_project pull
6971
7072 - name : Extract
7173 id : extract
8183 - uses : ./action-dlc
8284 name : Run satackey/action-docker-layer-caching@${{ steps.extract.outputs.branch }}
8385 with :
84- # repotag: test_project_node
8586 key : docker-layer-caching-test_project_node-sha:${{ github.sha }}-{hash}
8687 restore-keys : docker-layer-caching-test_project_node-sha:${{ github.sha }}-
8788
@@ -117,8 +118,6 @@ jobs:
117118 - build_and_push
118119
119120 steps :
120- - uses : actions/checkout@v2
121-
122121 - name : Extract
123122 id : extract
124123 run : |
Original file line number Diff line number Diff line change 1313
1414 steps :
1515 - uses : actions/checkout@v2
16+ - run : docker-compose -f test_project/docker-compose.yml -p test_project pull
1617 - uses : satackey/action-docker-layer-caching@v0.0
18+ - run : docker rmi $(docker image ls -q)
1719 - run : docker-compose -f test_project/docker-compose.yml -p test_project build --no-cache
1820
1921 cached_build :
2325
2426 steps :
2527 - uses : actions/checkout@v2
28+ - run : docker-compose -f test_project/docker-compose.yml -p test_project pull
2629 - uses : satackey/action-docker-layer-caching@v0.0
2730
2831 - name : Get cached image ID
Original file line number Diff line number Diff line change 11# action-docker-layer-caching [ ![ Readme Test] ( https://github.com/satackey/action-docker-layer-caching/workflows/Readme%20Test/badge.svg )] ( https://github.com/satackey/action-docker-layer-caching/actions?query=workflow%3A%22Readme+Test%22 ) [ ![ CI] ( https://github.com/satackey/action-docker-layer-caching/workflows/CI/badge.svg )] ( https://github.com/satackey/action-docker-layer-caching/actions?query=workflow%3ACI )
22
3- Enable docker layer caching by adding a single line.
3+ With only one additional line, you can enable Docker layer caching.
4+
5+ You can use ` docker build ` and ` docker-compose build ` with the cache without any special configuration,
6+ and there is also support for multi-stage builds.
47
58``` yaml
69name : Readme Test
1316
1417 steps :
1518 - uses : actions/checkout@v2
16- - uses : satackey/action-docker-layer-caching@v0.0 # Images created after this action is called are cached.
19+
20+ # Avoid caching pull-only images.(docker pull is faster than caching.)
21+ - run : docker-compose pull
22+
23+ # Images created after this action is called are cached.
24+ - uses : satackey/action-docker-layer-caching@v0.0
1725 - run : docker-compose build
1826` ` `
27+
28+ ---
29+
30+ By default, the cache is separated by the name of the workflow.
31+ You can configure manually cache keys.
32+
33+ ` ` ` yaml
34+ - uses : satackey/action-docker-layer-caching@v0.0
35+ with :
36+ key : foo-docker-cache-{hash}
37+ restore-keys : |
38+ foo-docker-cache-
39+ ` ` `
40+
41+ **Note: You must include ` {hash}` in the `key` input.** (`{hash}` will be replaced with the hash value of the docker image).
Original file line number Diff line number Diff line change 1+ FROM node:12-alpine as curl-env
2+ RUN set -x \
3+ apk update && \
4+ apk add curl && \
5+ mkdir -p /src && \
6+ curl -o /src/install.sh -L https://yarnpkg.com/install.sh && \
7+ chmod +x /src/install.sh && \
8+ apk del curl
9+
110FROM node:12-alpine
211
12+ COPY --from=curl-env /src/install.sh /tmp/install.sh
13+ RUN set -x \
14+ apk update && \
15+ apk add curl && \
16+ /tmp/install.sh && \
17+ apk del curl
18+
319WORKDIR /app
420COPY package.json yarn.lock ./
521RUN yarn install --frozen-lockfile
Original file line number Diff line number Diff line change @@ -5,3 +5,5 @@ services:
55 build :
66 context : ../
77 dockerfile : ./test_project/Dockerfile
8+ mysql_pull_only :
9+ image : mysql:8.0
You can’t perform that action at this time.
0 commit comments