Skip to content

Commit

Permalink
Merge pull request #26 from tmknight/develop
Browse files Browse the repository at this point in the history
Refine action workflows
  • Loading branch information
tmknight committed Jul 10, 2023
2 parents 98d3716 + 8a036ab commit f8dcc4f
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions .github/workflows/github-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,7 @@ jobs:
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- if: github.event_name == 'schedule'
name: Build and push Docker image on schedule
id: build-and-push-schedule
uses: docker/build-push-action@v4
with:
context: .
file: ${{ env.IMAGE }}.dockerfile
build-args: ${{ env.BUILD_ARGS }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.tag }}
labels: |
${{ steps.meta.outputs.labels }}
${{ env.ver }}
cache-from: type=gha
cache-to: type=gha,mode=max

- if: github.event_name != 'schedule'
name: Build and push Docker image
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
with:
Expand All @@ -135,17 +118,7 @@ jobs:
KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
run: 'echo "$KEY" > cosign.key'

- if: github.event_name == 'schedule'
name: Sign the published Docker image on schedule
env:
COSIGN_EXPERIMENTAL: "false"
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
## This step uses the identity token to provision an ephemeral certificate
## against the sigstore community Fulcio instance.
run: echo "${{ env.tag }}" | xargs -I {} cosign sign --key cosign.key {}@${{ steps.build-and-push.outputs.digest }}

- if: github.event_name != 'schedule' && github.event_name != 'pull_request'
name: Sign the published Docker image
- name: Sign the published Docker image
env:
COSIGN_EXPERIMENTAL: "false"
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
Expand Down

0 comments on commit f8dcc4f

Please sign in to comment.