Skip to content

feat: Added pending & failed message #27

feat: Added pending & failed message

feat: Added pending & failed message #27

name: self-service build and publish
on:
pull_request:
branches:
- develop
types:
- closed
jobs:
deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
env:
DEFAULT_BRANCH: develop
steps:
- name: Check if the source branch is a release branch
run: |
PR_BRANCH="${{ github.event.pull_request.head.ref }}"
echo "Source branch is $PR_BRANCH"
if [[ "$PR_BRANCH" == release/* ]]; then
echo "The source branch is a release branch, proceed with deployment."
curl -d '{"branch": "${{ env.DEFAULT_BRANCH }}", "parameters": {"run_deploy_prod": true}}' \
-H 'Content-Type: application/json' \
-H 'Circle-Token: ${{ secrets.CIRCLECI_API_TOKEN }}' \
-X POST https://circleci.com/api/v2/project/gh/sendbird/chat-ai-widget/pipeline
else
echo "The source branch is not a release branch, skipping deployment."
exit 0
fi