Skip to content

Commit

Permalink
feat: trigger internal CI on master commit
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Jul 25, 2024
1 parent e6c91cb commit 3bead17
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/on-master-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
tags: |
type=raw,value=master-${{ needs.generate-tags.outputs.tag_date }}-${{ needs.generate-tags.outputs.short_sha }}
type=raw,value=master-latest
trigger_internal_ci: true

notify-slack:
name: Notify Slack
Expand Down
30 changes: 29 additions & 1 deletion .github/workflows/publish-docker-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ on:
type: string
required: true
description: 'The images to publish'
trigger_internal_ci:
description: 'Trigger the internal CI'
required: false
type: boolean
default: false
workflow_dispatch:
inputs:
trigger_internal_ci:
description: 'Trigger the internal CI'
required: true
type: boolean
default: false

jobs:
build-and-push-image:
Expand Down Expand Up @@ -66,7 +77,7 @@ jobs:
tags: ${{ inputs.tags || format('type=raw,value={0}-{1}', github.ref_name, github.sha) }}

- name: Push to Registry(s)
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ github.event_name != 'pull_request' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
Expand All @@ -84,3 +95,20 @@ jobs:
annotations: true
severity: LOW
dockerfile: ./Dockerfile

trigger_ci:
runs-on: ubuntu-latest
needs:
- build-and-push-image
if: ${{ inputs.trigger_internal_ci }}
steps:
- name: Internal CI
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.INTERNAL_CI_TOKEN }}
repository: vechain/thor-internal-ci
event-type: internal-thor-ci
client-payload: |
{
"thor_image": ${{ fromJSON(steps.build-and-push-image.outputs.meta.json).tags[0] }}
}

0 comments on commit 3bead17

Please sign in to comment.