-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.72 KB
/
write-value.yaml
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
name: Write values.yaml
on:
repository_dispatch:
types: [write-values]
jobs:
write_values_file:
runs-on: ubuntu-latest
concurrency:
group: app-pipeline-group-${{ github.event.client_payload.appName }}
cancel-in-progress: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Create Directory
run: mkdir -p ./pipelines/${{ github.event.client_payload.appName }}
- name: Write values.yaml file
run: |
cat <<EOF > ./pipelines/${{ github.event.client_payload.appName }}/values.yaml
appName: ${{ github.event.client_payload.appName }}
git: ${{ github.event.client_payload.git }}
branch: ${{ github.event.client_payload.branch }}
port: ${{ github.event.client_payload.port }}
primaryHostname: ${{ github.event.client_payload.primaryHostname }}
EOF
- name: Commit and push changes
run: |
git config user.name "in-jun"
git config user.email "[email protected]"
git add .
git commit -m "Update values.yaml for ${{ github.event.client_payload.appName }}"
git push
- name: Trigger Generate GoCD Pipelines
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"event_type": "generate-pipelines"}' \
https://api.github.com/repos/injunweb/gitops-repo/dispatches