Skip to content

Commit

Permalink
feat: trigger internal CI on master commit (vechain#800)
Browse files Browse the repository at this point in the history
* feat: trigger internal CI on master commit

* refactor: keep in same run

* fix: continue on error

* fix: client payload

* test: CI trigger

* test: CI trigger

* fix: remove test trigger
  • Loading branch information
darrenvechain authored Aug 6, 2024
1 parent 58bfe18 commit ff68ae2
Show file tree
Hide file tree
Showing 2 changed files with 23 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
23 changes: 22 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,13 @@ jobs:
annotations: true
severity: LOW
dockerfile: ./Dockerfile

- name: Internal CI
uses: peter-evans/repository-dispatch@v3
if: ${{ inputs.trigger_internal_ci }}
continue-on-error: true
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 ff68ae2

Please sign in to comment.