From aa8350269f6e533f65d9b8e2c6479687213a1430 Mon Sep 17 00:00:00 2001 From: fastlorenzo Date: Mon, 10 Oct 2022 22:25:03 +0200 Subject: [PATCH] Updated workflow Signed-off-by: fastlorenzo --- .github/workflows/lint.yaml | 31 ++++++------- .github/workflows/main.yml | 92 ++++++++++++++++++------------------- 2 files changed, 58 insertions(+), 65 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index d0d92a2d..e4ad1d5b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,5 +1,3 @@ -# This is a basic workflow to help you get started with Actions - name: Helm lint # Controls when the workflow will run @@ -11,25 +9,24 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" lint: - # The type of runner that the job will run on runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Checkout chart + - name: Checkout uses: actions/checkout@v2 - - name: Install helm 3 - run: | - curl -s -L https://get.helm.sh/helm-v3.10.0-linux-amd64.tar.gz | tar xfvz - --strip-components=1 linux-amd64/helm - chmod 0700 helm - mv helm helm3 + with: + fetch-depth: 0 + + - name: Install Helm + uses: azure/setup-helm@v3 + with: + version: v3.10.0 + - name: Install dependencies run: | - ./helm3 repo add bitnami https://charts.bitnami.com/bitnami - ./helm3 dependency build mailu - - name: Running lint with helm v3 - run: ./helm3 lint --strict --values mailu/helm-lint-values.yaml mailu + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo update + + - name: Run helm lint + run: helm lint --strict --values mailu/helm-lint-values.yaml mailu diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dbad580a..d0eb1a0f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,5 @@ -# This is a basic workflow to help you get started with Actions - +--- name: CI - -# Controls when the workflow will run on: # Triggers the workflow on push or pull request events but only for the master branch push: @@ -10,56 +7,55 @@ on: #pull_request: # branches: [ master ] - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Checkout chart - uses: actions/checkout@v2 - - name: Install helm 2+3 - run: | - curl -s -L https://get.helm.sh/helm-v3.10.0-linux-amd64.tar.gz | tar xfvz - --strip-components=1 linux-amd64/helm - chmod 0700 helm - mv helm helm3 - - name: Install dependencies - run: | - ./helm3 repo add bitnami https://charts.bitnami.com/bitnami - ./helm3 dependency build mailu - - name: Running lint with helm v3 - run: ./helm3 lint --strict --values mailu/helm-lint-values.yaml mailu - - name: Checkout gh pages + - name: Checkout uses: actions/checkout@v2 with: - ref: 'gh-pages' - path: gh-pages - - name: Pack chart - run: | - ./helm3 package mailu -d gh-pages - ./helm3 repo index --url https://mailu.github.io/helm-charts/ gh-pages - ( cd gh-pages && ./index.html.sh > index.html ) - - name: Render chart to yamls - run: | - VERSION=$( grep mailu/Chart.yaml -e '^version:' | awk '{ print $2 }' ) - mkdir -p gh-pages/yaml - rm -rf gh-pages/yaml/${VERSION} - ./helm3 template mailu --values mailu/helm-lint-values.yaml --release-name mailu --namespace mailu --output-dir gh-pages/yaml/${VERSION} - - name: Show gh-pages changes - run: | - cd gh-pages - git status - - name: Pushing changes to gh-pages + fetch-depth: 0 + + - name: Install Helm + uses: azure/setup-helm@v3 + with: + version: v3.10.0 + + - name: Install dependencies run: | - git config --global user.email "actions@github.com" - git config --global user.name "Github actions" - cd gh-pages - git add . - git commit -m "Automated build" - git push + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo update + + - name: Run helm lint + run: helm lint --strict --values mailu/helm-lint-values.yaml mailu + + # - name: Checkout gh pages + # uses: actions/checkout@v2 + # with: + # ref: 'gh-pages' + # path: gh-pages + # - name: Pack chart + # run: | + # ./helm3 package mailu -d gh-pages + # ./helm3 repo index --url https://mailu.github.io/helm-charts/ gh-pages + # ( cd gh-pages && ./index.html.sh > index.html ) + # - name: Render chart to yamls + # run: | + # VERSION=$( grep mailu/Chart.yaml -e '^version:' | awk '{ print $2 }' ) + # mkdir -p gh-pages/yaml + # rm -rf gh-pages/yaml/${VERSION} + # ./helm3 template mailu --values mailu/helm-lint-values.yaml --release-name mailu --namespace mailu --output-dir gh-pages/yaml/${VERSION} + # - name: Show gh-pages changes + # run: | + # cd gh-pages + # git status + # - name: Pushing changes to gh-pages + # run: | + # git config --global user.email "actions@github.com" + # git config --global user.name "Github actions" + # cd gh-pages + # git add . + # git commit -m "Automated build" + # git push