Skip to content

Commit

Permalink
enable docker layer caching
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsmechtel committed Dec 2, 2024
1 parent e6c2d8f commit eba89f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
permissions:
contents: read
packages: write
id-token: write # Required for using GitHub Actions cache
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -24,6 +25,17 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-
- name: Build and push Docker image (latest tag)
uses: docker/[email protected]
with:
Expand All @@ -33,3 +45,5 @@ jobs:
tags: ghcr.io/${{ github.repository }}:latest
labels: |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit eba89f2

Please sign in to comment.