Skip to content

Commit

Permalink
Configure OS security updates
Browse files Browse the repository at this point in the history
Configure OS security updates forcing docker to not use cache when building from schedule and tags.

Signed-off-by: Leonardo Rodrigues de Mello <[email protected]>
  • Loading branch information
lmello authored Feb 15, 2024
1 parent aea62b9 commit 4ff549c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/docker-buid-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ jobs:

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
- name: Build and push Docker image with cache
id: build-and-push
if: github.event_name != 'schedule' || startsWith(github.ref, 'refs/tags/v') != true
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
Expand All @@ -81,7 +82,20 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push without cache
id: build-and-push-nocache
if: github.event_name == 'schedule' && startsWith(github.ref, 'refs/tags/v') == true
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
no-cache-filters: build
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
Expand Down

0 comments on commit 4ff549c

Please sign in to comment.