Skip to content

Commit

Permalink
Merge pull request #89 from simplerisk/fix-workflow
Browse files Browse the repository at this point in the history
Fix Github Action workflows
  • Loading branch information
jsokol authored Jun 25, 2024
2 parents a7c3920 + 5bfe9ec commit 415ced6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-to-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
main_image: true
secrets: inherit
simplerisk-minimal-php83:
name: 'Push simplerisk/simplerisk-minimal image based on PHP 8.1 with Apache'
name: 'Push simplerisk/simplerisk-minimal image based on PHP 8.3 with Apache'
uses: ./.github/workflows/push-to-dockerhub_rw.yml
with:
context_path: "simplerisk-minimal"
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/push-to-dockerhub_rw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,27 @@ on:
workflow_call:
inputs:
context_path:
description: Base path to perform the build
required: true
type: string
dockerfile_path:
description: Path where Dockerfile is located
required: true
type: string
image_name:
description: What would be the name of the image
required: true
type: string
version:
description: SimpleRisk version to upload
required: true
type: string
os_version:
description: Type of base image to put on the tag
required: true
type: string
main_image:
required: false
description: Is this the latest image?
default: false
type: boolean
secrets:
Expand Down Expand Up @@ -48,7 +53,7 @@ jobs:
images: ${{ inputs.image_name }}

- name: Build and push main Docker image
if: ${{ inputs.main_image == 'true' }}
if: ${{ inputs.main_image }}
id: build-and-push-main
uses: docker/build-push-action@v5
with:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/push-to-gh-pkgs_rw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ on:
required: true
type: string
main_image:
required: false
type: boolean
default: false
type: boolean

env:
# Use docker.io for Docker Hub if empty
Expand Down Expand Up @@ -68,7 +67,7 @@ jobs:

- name: Build and push main Docker image
id: build-and-push-main
if: ${{ inputs.main_image == 'true' }}
if: ${{ inputs.main_image }}
uses: docker/build-push-action@v5
with:
context: ${{ inputs.context_path }}
Expand All @@ -87,7 +86,7 @@ jobs:
# transparency data even for private images, pass --yes to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
if: ${{ inputs.main_image && github.event_name != 'pull_request' }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes {}@${{ steps.build-and-push-main.outputs.digest }}
Expand Down

0 comments on commit 415ced6

Please sign in to comment.