Skip to content

Sprint july 4

Sprint july 4 #6

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"}'