Skip to content

Commit 62b8e5b

Browse files
authored
Merge pull request #199 from macbre/ci-builds-speedup
Use Docker layers cache to speed up CI builds
2 parents 6585c0e + 50e0b36 commit 62b8e5b

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/dockerimage.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
name: Check if a Docker image can be built
22

3-
on: [push]
3+
on:
4+
push:
5+
branches: [ devel ]
6+
pull_request:
47

58
jobs:
69

710
build:
8-
911
runs-on: ubuntu-latest
1012

1113
steps:
1214
- uses: actions/checkout@v1
15+
1316
- name: Build the Docker image
17+
env:
18+
# @see https://testdriven.io/blog/faster-ci-builds-with-docker-cache/
19+
CACHE_IMAGE: macbre/index-digest:latest
1420
run: |
15-
docker build . --tag ${{ github.repository }}:$(date +%s)
21+
docker pull $CACHE_IMAGE
22+
docker build . \
23+
--cache-from $CACHE_IMAGE \
24+
--tag ${{ github.repository }}
1625
docker images

0 commit comments

Comments
 (0)