Skip to content

Commit

Permalink
update workflow actions
Browse files Browse the repository at this point in the history
  • Loading branch information
qno committed Jun 6, 2024
1 parent 7592fb7 commit 8120b16
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Extract Rack image version
run: |
Expand All @@ -33,12 +33,10 @@ jobs:
run: |
echo "RACK_SDK_VERSION=$(/bin/egrep -i '^RACK_SDK_VERSION.*:=' Makefile | cut -d ' ' -f 3)" >> $GITHUB_ENV
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v2

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
driver: docker-container

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
Expand All @@ -50,7 +48,7 @@ jobs:

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
Expand All @@ -61,17 +59,11 @@ jobs:
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' && !github.event.repository.private }}
env:
COSIGN_EXPERIMENTAL: "true"
run: cosign sign ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.build-and-push.outputs.digest }}

0 comments on commit 8120b16

Please sign in to comment.