Skip to content

Commit

Permalink
indent
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Nov 29, 2023
1 parent d359808 commit 411d3dc
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions .github/workflows/pr_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,44 +117,44 @@ jobs:
needs: [frontend_build_and_deploy, backend_build_and_deploy]
runs-on: ubuntu-latest
steps:
- name: check out code
uses: actions/checkout@master

- name: check out trigger branch
run: |
git fetch origin $BRANCH
git checkout $BRANCH
env:
BRANCH: ${{ github.head_ref }}

- name: Record branch env
id: branch
run: |
echo "repo=${{ github.repository }}" >> $GITHUB_OUTPUT
echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_OUTPUT
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- 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
- name: check out code
uses: actions/checkout@master

- name: check out trigger branch
run: |
git fetch origin $BRANCH
git checkout $BRANCH
env:
BRANCH: ${{ github.head_ref }}

- name: Record branch env
id: branch
run: |
echo "repo=${{ github.repository }}" >> $GITHUB_OUTPUT
echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_OUTPUT
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- 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 411d3dc

Please sign in to comment.