Skip to content

Commit

Permalink
tech: use a Github Action to trigger CircleCI
Browse files Browse the repository at this point in the history
This will let us trigger build-and-test workflow
on pull request only

See https://circleci.com/blog/trigger-circleci-pipeline-github-action/
  • Loading branch information
HEYGUL committed Sep 22, 2024
1 parent d6c4e33 commit 696bdc1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@

version: 2.1

parameters:
GHA_Actor:
type: string
default: ''
GHA_Action:
type: string
default: ''
GHA_Event:
type: string
default: ''
GHA_Meta:
type: string
default: ''

orbs:
browser-tools: circleci/[email protected]

Expand Down Expand Up @@ -93,6 +107,10 @@ executors:
workflows:
version: 2
build-and-test:
# This workflow is set to be conditionally triggered, only when
# the GitHub Action is triggered.
# With no other workflows, normal push events will be ignored currently.
when: << pipeline.parameters.GHA_Action >>
jobs:
- checkout:
context: Pix
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/trigger-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Trigger CircleCI

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push:
branches: dev

jobs:
trigger-ci:
runs-on: ubuntu-latest

steps:
- name: Trigger CircleCI
# ensure PR is not draft
if: '! github.event.pull_request.draft'
uses: CircleCI-Public/[email protected]
env:
CCI_TOKEN: ${{ secrets.GUL_TEST_TRIGGER_CIIRCLECI_TOKEN }}

0 comments on commit 696bdc1

Please sign in to comment.