Skip to content

Commit cd6e6be

Browse files
committed
Added deploy to CI.
1 parent 7b5b3ed commit cd6e6be

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/workflows/callable-deploy.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Trigger Deployment
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
repo:
7+
type: string
8+
required: true
9+
message:
10+
type: string
11+
required: true
12+
secrets:
13+
token:
14+
required: true
15+
16+
jobs:
17+
deploy:
18+
name: Trigger Deployment
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Dispatch Deployment
23+
uses: peter-evans/repository-dispatch@v3
24+
with:
25+
token: ${{ secrets.token }}
26+
repository: ${{ inputs.repo }}
27+
event-type: deploy
28+
client-payload: '{"message": "${{ inputs.message }}"}'

.github/workflows/on-push-main.yml

+11
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ jobs:
1515
image_tag: latest
1616
secrets:
1717
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
deploy:
20+
name: Trigger Deployment
21+
uses: ./.github/workflows/callable-deploy.yml
22+
needs:
23+
- build
24+
with:
25+
repo: ${{ vars.DEPLOYMENT_REPO }}
26+
message: Deployed from ${{ github.repository }} by ${{ github.actor }}
27+
secrets:
28+
token: ${{ secrets.REPO_DISPATCH_TOKEN }}

0 commit comments

Comments
 (0)