-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (53 loc) · 1.98 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Helm Chart Package and Push to Artifactory
on:
repository_dispatch:
types:
- helm-chart-push
workflow_dispatch:
inputs:
image_tag:
description: 'Docker Image Tag'
required: true
default: '1.65.0'
chart_version:
description: 'Helm Chart Version'
required: true
default: '1.65.0'
chart_name:
description: 'Helm Chart Name'
required: true
default: 'governor'
jobs:
helm:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./charts
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Helm
uses: Azure/[email protected]
with:
version: v3.11.0
id: install
- name: Extract Image Tag and Chart Version
id: extract_tags
run: |
if [ -z "${{ github.event.client_payload.image_tag }}" ]; then
echo "IMAGE_TAG=${{ github.event.inputs.image_tag }}" >> $GITHUB_ENV
echo "CHART_VERSION=${{ github.event.inputs.chart_version }}" >> $GITHUB_ENV
echo "CHART_NAME=${{ github.event.inputs.chart_name }}" >> $GITHUB_ENV
else
echo "IMAGE_TAG=${{ github.event.client_payload.image_tag }}" >> $GITHUB_ENV
echo "CHART_VERSION=${{ github.event.client_payload.chart_version }}" >> $GITHUB_ENV
echo "CHART_NAME=${{ github.event.client_payload.chart_name }}" >> $GITHUB_ENV
fi
- name: Package Helm chart with Image Tag
run: |
helm package ${{ env.CHART_NAME }} --version ${{ env.CHART_VERSION }} --app-version ${{ env.IMAGE_TAG }}
- name: Helm login && push to oci jfrog artifactory registry
run: |
helm registry login https://${{ vars.ARTIFACTORY_DOMAIN }} \
-u ${{ secrets.ARTIFACTORY_LOGIN }} -p ${{ secrets.ARTIFACTORY_PWD }}
helm push ${{ env.CHART_NAME }}-${{ env.CHART_VERSION }}.tgz oci://${{ vars.ARTIFACTORY_DOMAIN }}/helm