Skip to content

Commit

Permalink
Merge pull request energywebfoundation#21 from michalziobro/master
Browse files Browse the repository at this point in the history
DOI-2304
  • Loading branch information
michalziobro authored Jan 11, 2023
2 parents 1c6a2be + c492765 commit 29ab4d2
Show file tree
Hide file tree
Showing 14 changed files with 855 additions and 60 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint and validate chart

on: pull_request

jobs:
cancel-previous:
name: Cancel Previous Runs
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}

helm-check:
runs-on: ubuntu-latest
needs: [cancel-previous]
steps:
- uses: actions/checkout@v2
- name: helm-check
uses: igabaydulin/helm-check-action@0.2.0
env:
CHART_LOCATION: ./
CHART_VALUES: ./values.yaml
68 changes: 68 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: 'Release helm chart'

on:
push:
branches:
- master
paths:
- Chart.yaml

jobs:
cancel-previous:
name: Cancel Previous Runs
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

push-tag:
name: Push tag
runs-on: ubuntu-latest
needs: [cancel-previous]
outputs:
chart-version: ${{ steps.chart-version.outputs.CHART_VERSION }}
changelog: ${{ steps.tag_version.outputs.changelog }}
tag: ${{ steps.tag_version.outputs.new_tag }}
steps:
- uses: actions/checkout@v2

- name: Get Chart Version
id: chart-version
run: |
echo "CHART_VERSION=$(grep "version:" Chart.yaml | awk '{print $2}')" >> $GITHUB_OUTPUT
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: master
custom_tag: ${{ steps.chart-version.outputs.CHART_VERSION }}
custom_release_rules: major:major:Major Changes,minor:minor:Minor Changes,chore:patch:Chores

release:
name: Release helm chart
runs-on: ubuntu-latest
needs: [push-tag]

steps:
- name: Create a GitHub release
uses: ncipollo/release-action@v1.12.0
with:
tag: ${{ needs.push-tag.outputs.tag }}
name: Release ${{ needs.push-tag.outputs.tag }}
body: ${{ needs.push-tag.outputs.changelog }}

- uses: actions/checkout@v2

- name: Push Helm chart to OCI compatible registry (Github)
uses: bsord/helm-push@v4.2.0
with:
useOCIRegistry: true
registry-url: oci://ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
access-token: ${{ secrets.GITHUB_TOKEN }}
force: true
chart-folder: ./
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/norwoodj/helm-docs
rev: v1.11.0
hooks:
- id: helm-docs
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.0.9
hooks:
- id: helmlint
12 changes: 10 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
apiVersion: v2
name: microservice
description: A Helm chart for Kubernetes
name: generic-microservice-helm
description: Generic helm chart for Energy Web Foundation microservices

keywords:
- EnergyWeb
- blockchain

maintainers:
- name: EWF DevOps Team
email: devops@energyweb.org

# A chart can be either an 'application' or a 'library' chart.
#
Expand Down
Loading

0 comments on commit 29ab4d2

Please sign in to comment.