-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (59 loc) · 2.07 KB
/
push.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
name: Push
on:
push:
branches:
- '*'
tags:
- '*'
env:
DOCKER_HOSTNAME: ghcr.io
DOCKER_NAMESPACE: fybrik
DOCKER_USERNAME: ${{ github.actor }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Versions are created as follows:
# - Tags starting with v will be released as what comes after `v`. (e.g. refs/tags/v1.0 -> 1.0).
# - Release branches will be released as the release number (e.g. refs/heads/releases/1.0 -> 1.0-rc).
# - Other branches (e.g. main) will be released with branch name as version for the docker images.
# For the helm chart OCI reference tag 0.0.0-<branch-name> will be used.
- id: version
name: Infer version
run: |
version="${GITHUB_REF#refs/tags/v}"
echo "HELM_TAG=${version}" >> $GITHUB_ENV
if [[ $version == refs/* ]] ;
then
branch="${GITHUB_REF#refs/heads/}"
version=$branch
echo "HELM_TAG=0.0.0-${version}" >> $GITHUB_ENV
elif [[ $version == releases/* ]] ;
then
releaseVersion="${GITHUB_REF#refs/heads/releases/}"
version="$releaseVersion-rc"
echo "HELM_TAG=$releaseVersion-rc" >> $GITHUB_ENV
fi
echo "DOCKER_TAGNAME=$version" >> $GITHUB_ENV
- name: Helm tool installer
uses: Azure/setup-helm@v1
with:
version: v3.6.3
- name: Build docker image
run: make docker-build
- name: Docker push
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login -u "${{ env.DOCKER_USERNAME }}" --password-stdin "${{ env.DOCKER_HOSTNAME }}"
make docker-push
- run: docker images
- name: Install yq
run: make ./hack/tools/bin/yq
- name: Update docker image tag in the chart value.yaml file
run: ./hack/tag_value.sh
- name: Helm chart push
run: |
export HELM_EXPERIMENTAL_OCI=1
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login -u "${{ github.actor }}" --password-stdin "${{ env.DOCKER_HOSTNAME }}"
make helm-chart-push