-
Notifications
You must be signed in to change notification settings - Fork 4
43 lines (39 loc) · 1.36 KB
/
publish-staging.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
name: publish-staging
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+\-alpha'
- 'v[0-9]+.[0-9]+.[0-9]+\-alpha\.[0-9]+'
jobs:
package-and-publish:
runs-on: 'ubuntu-20.04'
steps:
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
strip_v: true
- name: Checkout
uses: actions/checkout@v2
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.8.1
- name: Run Package and Publish
env:
HELM_USER: ${{secrets.KOTS_HELM_USER_STAGING}}
HELM_PASS: ${{secrets.KOTS_HELM_PASS_STAGING}}
CHART_VERSION: ${{steps.tag.outputs.tag}}
run: |
export KOTS_VERSION=${CHART_VERSION%-*}
export KOTS_TAG=v${KOTS_VERSION}
export KOTSADM_REGISTRY=kotsadm # docker.io is implicit
curl -O -L https://raw.githubusercontent.com/replicatedhq/kots/${KOTS_TAG}/.image.env
export $(cat .image.env | sed 's/#.*//g' | xargs)
envsubst < Chart.yaml.tmpl > Chart.yaml
envsubst < values.yaml.tmpl > values.yaml
rm -f *.tmpl
export CHART_NAME=`helm package . | rev | cut -d/ -f1 | rev`
echo pushing ${CHART_NAME} to staging
helm registry login registry.staging.replicated.com --username $HELM_USER --password $HELM_PASS
helm push $CHART_NAME oci://registry.staging.replicated.com/library