diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5bd35c9..bc72d58 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -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 @@ -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/build-push-action@v5.0.0 with: @@ -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