-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (65 loc) · 2.16 KB
/
build.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build and push container image
on:
workflow_dispatch:
push:
tags:
- '*'
branches:
- main
env:
REGISTRY: quay.io
IMAGE_NAME: jumpstarter-dev/jumpstarter-controller
QUAY_ORG: quay.io/jumpstarter-dev
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
run: |
VERSION=$(git describe --tags)
VERSION=${VERSION#v} # remove the leading v prefix for version
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "VERSION=${VERSION}"
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: jumpstarter-dev+jumpstarter_ci
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push Docker image
run: |
make ko-push IMG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }},latest
publish-helm-charts-containers:
needs: build-and-push-image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
run: |
VERSION=$(git describe --tags)
VERSION=${VERSION#v} # remove the leading v prefix for version
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "VERSION=${VERSION}"
- name: Build helm charts
run: |
echo packaging ${VERSION}
# patch the sub-chart app-version, because helm package won't do it
sed -i "s/^appVersion:.*/appVersion: $VERSION/" deploy/helm/jumpstarter/charts/jumpstarter-controller/Chart.yaml
helm package ./deploy/helm/jumpstarter --version "${VERSION}" --app-version "${VERSION}"
- name: Login helm
env:
PASSWORD: ${{ secrets.QUAY_TOKEN }}
USER: jumpstarter-dev+jumpstarter_ci
run:
helm registry login quay.io -u ${USER} -p ${PASSWORD}
- name: Push helm charts
run: |
helm push jumpstarter-*.tgz oci://${{ env.QUAY_ORG }}/helm