Skip to content

Commit 24947fb

Browse files
authored
Update README.md
1 parent 89f36aa commit 24947fb

File tree

1 file changed

+33
-7
lines changed

1 file changed

+33
-7
lines changed

README.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
# action-docker-layer-caching [![Readme Test status is unavailable](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 status is unavailable](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 only one line.
3+
Enable Docker Layer Caching by adding a single line in GitHub Actions.
44

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.
5+
You can run `docker build` and `docker-compose build` in your GitHub Actions workflow using the cache with no special configuration, and it also supports multi-stage builds.
76

8-
This action uses the [docker save](https://docs.docker.com/engine/reference/commandline/save/) / [docker load](https://docs.docker.com/engine/reference/commandline/load/) command and the [@actions/cache](https://www.npmjs.com/package/@actions/cache) library.
7+
This GitHub Action uses the [docker save](https://docs.docker.com/engine/reference/commandline/save/) / [docker load](https://docs.docker.com/engine/reference/commandline/load/) command and the [@actions/cache](https://www.npmjs.com/package/@actions/cache) library.
98

109

1110
## Example workflow
1211

12+
### Docker Compose
1313
```yaml
14-
name: Readme Test
15-
14+
name: CI
1615
on: push
1716

1817
jobs:
@@ -31,7 +30,34 @@ jobs:
3130
# It also restores the cache if it exists.
3231
- uses: satackey/action-docker-layer-caching@v0.0
3332

34-
- run: docker-compose build
33+
- run: docker-compose up --build
34+
35+
# Finally, "Post Run satackey/action-docker-layer-caching@v0.0",
36+
# which is the process of saving the cache, will be executed.
37+
```
38+
39+
40+
### docker build
41+
42+
```yaml
43+
name: CI
44+
45+
on: push
46+
47+
jobs:
48+
build:
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- uses: actions/checkout@v2
53+
54+
# In this step, this action saves a list of existing images,
55+
# the cache is created without them in the post run.
56+
# It also restores the cache if it exists.
57+
- uses: satackey/action-docker-layer-caching@v0.0
58+
59+
- name: Build the Docker image
60+
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
3561

3662
# Finally, "Post Run satackey/action-docker-layer-caching@v0.0",
3763
# which is the process of saving the cache, will be executed.

0 commit comments

Comments
 (0)