Skip to content

Commit

Permalink
Merge pull request #48 from XinFinOrg/fix-workflow-2
Browse files Browse the repository at this point in the history
no auto deploy for csc
  • Loading branch information
wanwiset25 authored Jul 26, 2024
2 parents c4eed2e + 63f6f9d commit 8a4741a
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions .github/workflows/pr_deploy.yml → .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build and deploy devnet
name: Build custom branch
on:
pull_request_target:
branches:
- master

jobs:
build_and_deploy:
build:
if: |
( startsWith(github.head_ref, 'feature') ||
startsWith(github.head_ref, 'fix') )
Expand Down Expand Up @@ -49,28 +49,3 @@ jobs:
run: |
docker build . --file docker/Dockerfile --tag ${{ steps.image.outputs.name }}
docker push ${{ steps.image.outputs.name }}
- name: trigger deploy workflow
id: trigger_deploy
run: |
echo "RESPONSE_CODE=$( \
curl -L \
-o response.txt \
-w %{response_code} \
-s \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.CICD_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/hash-laboratories-au/subnet-deployment/actions/workflows/subnet-deploy.yaml/dispatches \
-d '{"ref":"master", "inputs":{"caller_repo": "${{ steps.branch.outputs.repo }}", "caller_ref": "${{ steps.branch.outputs.branch }}", "caller_sha": "${{ steps.branch.outputs.commit }}"}}' \
)" >> $GITHUB_ENV
- name: Check response fail or success
run: |
cat response.txt
echo "RESPONSE_CODE=${{ env.RESPONSE_CODE }}"
if [ ${{ env.RESPONSE_CODE }} != 204 ]
then
exit 1
fi

0 comments on commit 8a4741a

Please sign in to comment.