chore(github_actions): Migrate travis to github actions for chaos-charts (#403)
chore(github_actions): Migrate travis to github actions for chaos-charts Signed-off-by: udit <udit.gaurav@mayadata.io>
This commit is contained in:
39
.github/workflows/build.yml
vendored
Normal file
39
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
# This workflow will combine the experiment CRs for different
|
||||
# Categories of experiments into the experiment.yaml in respective
|
||||
# Chart directory. It will only build and not push the changes.
|
||||
|
||||
name: ChaosCharts
|
||||
on:
|
||||
pull_request:
|
||||
types: [ opened, synchronize, reopened ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
# Install golang
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '^1.13.1'
|
||||
|
||||
# Setup gopath
|
||||
- name: Setting up GOPATH
|
||||
run: |
|
||||
echo "GOPATH=${GITHUB_WORKSPACE}/go" >> $GITHUB_ENV
|
||||
|
||||
# Checkout to the latest commit
|
||||
# On specific directory/path
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{steps.getcommit.outputs.sha}}
|
||||
path: go/src/github.com/${{github.repository}}
|
||||
|
||||
# Combine the experiment CRs
|
||||
- name: Combine experiment CR
|
||||
run: |
|
||||
export PATH=$PATH:$(go env GOPATH)/bin
|
||||
cd ${GOPATH}/src/github.com/${{github.repository}}
|
||||
make combineExpCR
|
||||
shell: bash
|
54
.github/workflows/push.yml
vendored
Normal file
54
.github/workflows/push.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
# This workflow will combine the experiment CRs for different
|
||||
# Categories of experiments into the experiment.yaml in respective
|
||||
# Chart directory and push the changes.
|
||||
|
||||
name: ChaosCharts
|
||||
on: [ push ]
|
||||
|
||||
jobs:
|
||||
push:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'litmuschaos/chaos-charts'
|
||||
steps:
|
||||
|
||||
# Install golang
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '^1.13.1'
|
||||
|
||||
# Setup gopath
|
||||
- name: Setting up GOPATH
|
||||
run: |
|
||||
echo "GOPATH=${GITHUB_WORKSPACE}/go" >> $GITHUB_ENV
|
||||
|
||||
# Checkout to the latest commit
|
||||
# On specific directory/path
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{steps.getcommit.outputs.sha}}
|
||||
path: go/src/github.com/${{github.repository}}
|
||||
|
||||
# Combine the experiment CRs
|
||||
- name: Combine experiment CR
|
||||
run: |
|
||||
export PATH=$PATH:$(go env GOPATH)/bin
|
||||
cd ${GOPATH}/src/github.com/${{github.repository}}
|
||||
make combineExpCR
|
||||
shell: bash
|
||||
|
||||
# Commit the changes from the chart directory
|
||||
- name: Commit the changes
|
||||
run: |
|
||||
cd ${GOPATH}/src/github.com/${{github.repository}}
|
||||
make push
|
||||
shell: bash
|
||||
|
||||
# Push the changes
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: ${{ github.ref }}
|
||||
directory: go/src/github.com/${{github.repository}}
|
||||
|
Reference in New Issue
Block a user