Skip to content

Commit

Permalink
Refactor docker-publish.yml to optimize caching strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvis2f committed Apr 7, 2024
1 parent 225ab9e commit 3ace305
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/[email protected]
with:
cosign-release: "v2.1.1"

- name: Docker Setup QEMU
uses: docker/[email protected]

Expand Down Expand Up @@ -71,23 +63,8 @@ jobs:
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
cache-from: type=registry,ref=jarvis2f/vortex:buildcache
cache-to: type=registry,ref=jarvis2f/vortex:buildcache,mode=max

- name: Dockerhub Readme
if: github.event_name != 'pull_request'
Expand Down

0 comments on commit 3ace305

Please sign in to comment.