Skip to content

Commit

Permalink
Merge pull request #259 from wallarm/DEVOPS-2147
Browse files Browse the repository at this point in the history
DEVOPS-2147 Add rc version of helm-chart push
  • Loading branch information
xDmitriev authored Aug 15, 2023
2 parents 2c07bbf + 0a14ffe commit 793f724
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions .github/workflows/helm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+\+upstream*'
- '[0-9]+.[0-9]+.[0-9]+-rc*'

permissions:
contents: read
Expand All @@ -12,6 +13,7 @@ jobs:
runs-on: self-hosted-1cpu
outputs:
chart_version: ${{ steps.extract_tag.outputs.tag }}
release_type: ${{ steps.check_release.outputs.type }}
steps:
- name: Import secrets
uses: hashicorp/vault-action@cb841f2c86fb6d07cff94fda240828c1abc5ba43 # v2.7.3
Expand All @@ -30,11 +32,41 @@ jobs:
- name: Extract tag name
id: extract_tag
run: |
X_TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/\+.*$//g')
X_TAG=$(echo ${GITHUB_REF#refs/*/} | sed 's/[+-].*$//g')
echo "X_TAG=${X_TAG}" >> $GITHUB_ENV
echo "tag=${X_TAG}" >> $GITHUB_OUTPUT
- name: Publish Helm charts
- name: Check release type
id: check_release
run: |
TYPE="production"
if [[ ${GITHUB_REF#refs/*/} =~ "rc" ]]; then
TYPE="release-candidate"
fi
echo "Release type: ${TYPE}"
echo "type=${TYPE}" >> $GITHUB_OUTPUT
- name: Publish Helm charts (Prod)
if: steps.check_release.outputs.type == 'production'
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # master
with:
token: ${{ steps.secrets.outputs.GITHUB_TOKEN }}
charts_dir: ./charts
charts_url: https://charts.wallarm.com
linting: off
repository: helm-charts
branch: main
target_dir: "wallarm-ingress"
index_dir: .
app_version: "${{ env.X_TAG }}"
chart_version: "${{ env.X_TAG }}"

- name: Update chart name for RC versions
if: steps.check_release.outputs.type == 'release-candidate'
run: yq -y -i '.name = "wallarm-ingress-rc"' ./charts/ingress-nginx/Chart.yaml

- name: Publish Helm charts (RC)
if: steps.check_release.outputs.type == 'release-candidate'
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # master
with:
token: ${{ steps.secrets.outputs.GITHUB_TOKEN }}
Expand All @@ -43,13 +75,14 @@ jobs:
linting: off
repository: helm-charts
branch: main
target_dir: wallarm-ingress
target_dir: "wallarm-ingress-rc"
index_dir: .
app_version: "${{ env.X_TAG }}"
chart_version: "${{ env.X_TAG }}"

update_version:
name: Update package version
if: needs.release.outputs.release_type == 'production'
runs-on: self-hosted-1cpu
needs: release
steps:
Expand Down

0 comments on commit 793f724

Please sign in to comment.