Skip to content

Commit

Permalink
Merge pull request meshery#2675 from layer5io/feat/helm-ci
Browse files Browse the repository at this point in the history
Add the CI for auto release the Helm chart
  • Loading branch information
leecalcote committed Apr 9, 2021
2 parents 587e42a + 081f4d3 commit 6d15b4e
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/helm-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Release Charts
on:
push:
branches:
- 'master'
paths:
- 'install/kubernetes/**'
pull_request:
branches:
- 'master'
paths:
- 'install/kubernetes/**'
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: v3.4.1
- name: Helm lint
env:
CHARTS_PATH: install/meshery
run:
helm lint ${{ env.CHARTS_PATH }}

release:
runs-on: ubuntu-latest
needs: [lint-test]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
env:
GITHUB_ACTOR: Aisuko
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.4.1
- name: Add dependency chart repos
run: |
helm repo add meshery https://meshery.io/charts/
- name: Helm Chart Releaser For Remote
uses: Aisuko/chart-releaser-action@v1.0.0-alpha.14
with:
charts_dir: install/kubernetes/helm
owner: layer5io
repo: layer5io/meshery.io
# For helm charts index
charts_repo_url: https://meshery.io/charts/
pages_branch: master
activity: none
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Checkout target repo
uses: actions/checkout@v2
env:
REPO: layer5io/meshery.io
REPO_PATH: meshery.io
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
repository: "${{ env.REPO }}"
path: ${{ env.REPO_PATH }}
- name: Copy index to new repo
env:
SOURCE: /home/runner/work/meshery/meshery/.cr-index/index.yaml
TARGET: meshery.io/charts
run:
cp ${{ env.SOURCE }} ${{ env.TARGET }}
- name: Push
env:
REPO_PATH: meshery.io
GIT_USERNAME: Aisuko
GIT_EMAIL: Aisuko@users.noreply.github.com
run: |
cd ${{ env.REPO_PATH }}
git config --local user.name "${{ env.GIT_USERNAME }}"
git config --local user.email "${{ env.GIT_EMAIL }}"
git add .
git commit -s -m "Github Actions Automatically Built in `date +"%Y-%m-%d %H:%M"`"
git push
7 changes: 7 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://github.com/helm/chart-testing#configuration
remote: origin
chart-dirs:
- install/kubernetes/helm/meshery
chart-repos:
- meshery=https://meshery.io/charts/
helm-extra-args: --timeout 600s

0 comments on commit 6d15b4e

Please sign in to comment.