ci: update workflow branches #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: self-service build and publish | ||
env: | ||
DEFAULT_BRANCH: develop | ||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
types: | ||
- closed | ||
jobs: | ||
deploy: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
env: | ||
CIRCLECI_TOKEN: ${{ secrets.CIRCLECI_API_TOKEN }} | ||
DEFAULT_BRANCH: ${{ env.DEFAULT_BRANCH }} | ||
Check failure on line 19 in .github/workflows/self-service-publish.yml GitHub Actions / self-service build and publishInvalid workflow file
|
||
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\": \"${DEFAULT_BRANCH}\", \"parameters\": {\"run_deploy_prod\": true}}' \ | ||
-H 'Content-Type: application/json' \ | ||
-H 'Circle-Token: ${CIRCLECI_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 |