mirror of
https://github.com/ysoftdevs/imagepullsecret-injector.git
synced 2026-01-17 00:57:10 +01:00
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Release Charts
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'helm/**'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v1
|
|
with:
|
|
ref: main
|
|
|
|
- name: Configure Git
|
|
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.0
|
|
|
|
- name: Helm version checker
|
|
id: helm-version-checker
|
|
continue-on-error: true
|
|
run: |
|
|
newVersion="$(helm show chart helm/imagepullsecret-injector | grep version: | awk '{print $2}')"
|
|
uploadedVersions="$(helm search repo imagepullsecret-injector/imagepullsecret-injector -l | tail -n +2 | awk '{print $2}')"
|
|
for uploadedVersion in $uploadedVersions; do
|
|
if [ "$newVersion" == "$uploadedVersion" ]; then
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
|
|
- name: Run chart-releaser
|
|
if: ${{ step.helm-version-checker.outcome == 'success' }}
|
|
uses: helm/chart-releaser-action@master
|
|
with:
|
|
charts_dir: 'helm'
|
|
env:
|
|
CR_TOKEN: '${{ secrets.CR_TOKEN }}' |