Skip to content

Commit 8277ba3

Browse files
committed
chore: update CircleCI deployment step to use REST API with environment variables
1 parent afc1121 commit 8277ba3

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

.github/workflows/publish-sample.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,27 @@ jobs:
2121
execute:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
25-
- name: '[${{ github.event.inputs.platform }}] Deploy trigger'
26-
if: ${{github.event.inputs.platform}}
27-
uses: promiseofcake/circleci-trigger-action@v1
28-
with:
29-
user-token: ${{ secrets.CIRCLECI_PERSONAL_API_TOKEN }}
30-
project-slug: sendbird/sendbird-uikit-react-native
31-
branch: ${{ env.BRANCH_NAME }}
32-
payload: '{"platform": "${{ github.event.inputs.platform }}", "version": "${{ github.event.inputs.version }}" }'
24+
- name: Set BRANCH_NAME env
25+
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
26+
27+
- name: '[${{ github.event.inputs.platform }}] Deploy trigger (CircleCI REST API)'
28+
if: ${{ github.event.inputs.platform }}
29+
env:
30+
CIRCLECI_PERSONAL_API_TOKEN: ${{ secrets.CIRCLECI_PERSONAL_API_TOKEN }}
31+
BRANCH_NAME: ${{ env.BRANCH_NAME }}
32+
PLATFORM: ${{ github.event.inputs.platform }}
33+
VERSION: ${{ github.event.inputs.version }}
34+
run: |
35+
curl -u ${CIRCLECI_PERSONAL_API_TOKEN}: \
36+
-X POST "https://circleci.com/api/v2/project/gh/sendbird/sendbird-uikit-react-native/pipeline" \
37+
-H "Content-Type: application/json" \
38+
-d '{
39+
"branch": "'"${BRANCH_NAME}"'",
40+
"parameters": {
41+
"platform": "'"${PLATFORM}"'",
42+
"version": "'"${VERSION}"'"
43+
}
44+
}'
3345
3446
#env:
3547
# CACHE_NODE_MODULES_PATH: |

0 commit comments

Comments
 (0)