Skip to content

Commit

Permalink
Github Actions - use GitHub cache for Docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMikes authored and ondrejmirtes committed Jun 1, 2022
1 parent a7ae2a6 commit 88d3806
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/docker-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to ghcr
uses: docker/login-action@v2
with:
Expand All @@ -65,5 +57,5 @@ jobs:
push: true
tags: "ghcr.io/phpstan/phpstan:nightly${{ matrix.image-tag-suffix }}"
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
12 changes: 2 additions & 10 deletions .github/workflows/docker-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to ghcr
uses: docker/login-action@v2
with:
Expand All @@ -64,5 +56,5 @@ jobs:
push: true
tags: "ghcr.io/phpstan/phpstan:latest${{ matrix.image-tag-suffix }},ghcr.io/phpstan/phpstan:1${{ matrix.image-tag-suffix }},ghcr.io/phpstan/phpstan:${{ steps.get_version.outputs.VERSION }}${{ matrix.image-tag-suffix }}"
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}

0 comments on commit 88d3806

Please sign in to comment.