-
Notifications
You must be signed in to change notification settings - Fork 23
71 lines (63 loc) · 2.39 KB
/
config-change-0helm-pr.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: config_change_PR
on:
push:
branches:
- staging
paths:
- config/0chain_blobber.yaml
- config/0chain_validator.yaml
pull_request:
branches:
- staging
types:
- closed
paths:
- config/0chain_blobber.yaml
- config/0chain_validator.yaml
jobs:
ConfigChange:
runs-on: arc-runner
steps:
- uses: actions/checkout@v1
- name: Get changed files using defaults
id: changed-files
uses: tj-actions/[email protected]
- name: "Clone 0helm"
if: ${{ contains(steps.changed-files.outputs.modified_files, 'config/0chain_blobber.yaml') || contains(steps.changed-files.outputs.modified_files, 'config/0chain_validator.yaml') }}
uses: actions/checkout@v2
with:
ref: one-pool-staging-test
repository: 0chain/0helm
fetch-depth: 1
path: ./0helm
token: ${{ secrets.ACCESS_TOKEN }}
- name: "Copy 0chain.yaml and sc.yaml in 0helm one-pool-staging-test branch"
if: ${{ contains(steps.changed-files.outputs.modified_files, 'config/0chain_blobber.yaml') || contains(steps.changed-files.outputs.modified_files, 'config/0chain_validator.yaml') }}
run: |
touch 0helm/updated_configs/0chain_blobber.yaml
touch 0helm/updated_configs/0chain_validator.yaml
cp config/0chain_blobber.yaml 0helm/updated_configs/0chain_blobber.yaml
cp config/0chain_validator.yaml 0helm/updated_configs/0chain_validator.yaml
- name: Push Updated Code in 0helm one-pool-staging-test branch
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.ACCESS_TOKEN }}
publish_dir: ./0helm/updated_configs
destination_dir: updated_configs
publish_branch: one-pool-staging-test
keep_files: true
external_repository: "0chain/0helm"
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
PR:
runs-on: 'arc-runner'
environment: 'HelmRepo'
needs: [ConfigChange]
steps:
- name: Raise PR
run: |
curl -X POST \
-H "Authorization: Bearer ${{secrets.ACCESS_TOKEN}}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/0chain/0helm/actions/workflows/raise_pr.yaml/dispatches \
-d '{"ref": "staging"}'