File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Trigger Deployment Workflows
2+
3+ on :
4+ push :
5+ branches :
6+ - dev
7+ - edge
8+ - main
9+ - prod
10+
11+ jobs :
12+ trigger-deployment :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : repository-dispatch-app token
16+ id : repository-dispatch-app
17+ uses : actions/create-github-app-token@v1
18+ with :
19+ app-id : ${{ secrets.REPOSITORY_DISPATCH_APP_ID }}
20+ private-key : ${{ secrets.REPOSITORY_DISPATCH_APP_PRIVATE_KEY }}
21+ owner : ${{ github.repository_owner }}
22+ - name : Extract branch name
23+ shell : bash
24+ run : echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
25+
26+ - name : Map main branch to prod for dispatch
27+ if : env.BRANCH_NAME == 'main'
28+ run : echo "DISPATCH_TYPE=node-oidc-provider-prod-push" >> $GITHUB_ENV
29+
30+ - name : Set dispatch type for other branches
31+ if : env.BRANCH_NAME != 'main'
32+ run : echo "DISPATCH_TYPE=node-oidc-provider-${{ env.BRANCH_NAME }}-push" >> $GITHUB_ENV
33+
34+ - name : Trigger repository dispatch event
35+ uses : peter-evans/repository-dispatch@v2
36+ with :
37+ token : ${{ steps.repository-dispatch-app.outputs.token }}
38+ repository : upbond/upbond-login-cicd
39+ event-type : ${{ env.DISPATCH_TYPE }}
40+ client-payload : ' {"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "repository": "${{ github.repository }}"}'
You can’t perform that action at this time.
0 commit comments