Skip to content

Commit 58a5791

Browse files
push buildcache before tests
1 parent 91dbe29 commit 58a5791

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
username: ${{ secrets.DOCKERHUB_USERNAME }}
3030
password: ${{ secrets.DOCKERHUB_TOKEN }}
3131

32-
- name: Build and export to Docker
32+
- name: Build Docker image
3333
uses: docker/build-push-action@v3
3434
with:
3535
context: .
@@ -38,6 +38,13 @@ jobs:
3838
cache-from: type=registry,ref=${{ env.DOCKERHUB_REPO }}:buildcache
3939
tags: ${{ env.DOCKERHUB_REPO }}:testing
4040

41+
# push cache that includes production and testing
42+
- name: Push buildcache to DockerHub
43+
uses: docker/build-push-action@v2
44+
with:
45+
context: .
46+
cache-to: type=registry,ref=${{ env.DOCKERHUB_REPO }}:buildcache,mode=max
47+
4148
- name: Test pull request
4249
if: github.event.pull_request.merged == false
4350
run: |
@@ -52,11 +59,4 @@ jobs:
5259
push: true
5360
tags: ${{ env.DOCKERHUB_REPO }}:latest
5461

55-
# push cache that includes production and testing
56-
- name: Push buildcache to DockerHub on merge
57-
uses: docker/build-push-action@v2
58-
if: github.event.pull_request.merged == true
59-
with:
60-
context: .
61-
cache-to: type=registry,ref=${{ env.DOCKERHUB_REPO }}:buildcache,mode=max
6262

0 commit comments

Comments
 (0)