-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.56 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Update the deployment repository
on:
push:
branches:
- main
jobs:
update-deployment-repository:
runs-on: ubuntu-latest
steps:
- name: Update the repository in the deployment repository
run: |
# Define the repository we are pushing to
repo_owner="EVE-KILL"
repo_name="Deployment"
# Define the event type
event_type="update-killboard"
# Define the branch we are pushing to
branch="main"
# Define the commit hash we just pushed
commit_hash=${{ github.sha }}
# Echo out the variables
echo "Commit Hash: $commit_hash"
echo "Platform Environment: $branch"
echo "Push to repository: $repo_owner/$repo_name"
echo "Event Type: $event_type"
# Create the json payload we will send to the repository dispatch event
payload='{
"event_type": "'$event_type'",
"client_payload":
{
"submodule": "killboard",
"environment": "'$branch'",
"commit": "'$commit_hash'"
}
}'
payload=$(echo $payload | jq -c .)
# Trigger the repository dispatch event
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.REPO_ACCESS_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "$payload"