Skip to content

Commit 0dc754f

Browse files
Merge pull request #5 from upbond/main
merge main
2 parents e8b39bb + 9948744 commit 0dc754f

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 }}"}'

0 commit comments

Comments
 (0)