-
Notifications
You must be signed in to change notification settings - Fork 33
44 lines (44 loc) · 1.64 KB
/
chartpress.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
name: Chartpress Publish
on: push
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Setup git
run: git config --global user.email "[email protected]" && git config --global user.name "Github Action"
- name: Install Chartpress and some python modules
run: |
pip install -v chartpress && pip install six && pip install yq
- name: Set env vars for publish charts
run: |
GIT_BRANCH_NAME=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
GIT_BRANCH_NAME=${GIT_BRANCH_NAME/\//_}
OSM_SEED_VERSION=$(yq -r .appVersion ./osm-seed/Chart.yaml)
SHORT_GITHUB_SHA=${GITHUB_SHA::7}
echo "GIT_BRANCH_NAME=$GIT_BRANCH_NAME" >> $GITHUB_ENV
echo "OSM_SEED_VERSION=$OSM_SEED_VERSION" >> $GITHUB_ENV
echo "SHORT_GITHUB_SHA=$SHORT_GITHUB_SHA" >> $GITHUB_ENV
- name: Run Chartpress
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
run: |
if [[ $GIT_BRANCH_NAME = "main" ]]
then
chartpress --push --publish-chart --tag ${OSM_SEED_VERSION}
elif [[ $GIT_BRANCH_NAME = "develop" ]]
then
chartpress --push --publish-chart --tag ${OSM_SEED_VERSION}-dev.h$SHORT_GITHUB_SHA
else
chartpress --push --publish-chart
fi