-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added release github action support (#7)
Signed-off-by: Raviv Schaffer <[email protected]>
- Loading branch information
Showing
3 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Push | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
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 (In helm 3.7 and above OCI reference tags | ||
# must be valid SemVer): | ||
# - Tags starting with v will be released as what comes after `v`. (e.g. refs/tags/v1.0 -> 1.0). | ||
# - Main branch will be released with `main` as version tag for the docker images and | ||
# `0.0.0-master` tag for helm chart. | ||
- id: version | ||
name: Infer version | ||
run: | | ||
if [[ ${GITHUB_REF} == refs/tags/* ]] ; | ||
then | ||
version="${GITHUB_REF#refs/tags/v}" | ||
echo "HELM_TAG=${version}" >> $GITHUB_ENV | ||
elif [[ ${GITHUB_REF} == refs/heads/main ]] ; | ||
then | ||
version=main | ||
echo "HELM_TAG=0.0.0-main" >> $GITHUB_ENV | ||
fi | ||
echo "DOCKER_TAG=${version}" >> $GITHUB_ENV | ||
- name: Helm tool installer | ||
uses: Azure/setup-helm@v1 | ||
with: | ||
version: v3.7.0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
pip install pipenv | ||
- name: Build docker image | ||
run: make 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2020 IBM Corp. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
: ${TOOLBIN:=./hack/tools/bin} | ||
|
||
${TOOLBIN}/yq eval --inplace ".image.tag = \"$DOCKER_TAG\"" helm/delete-module/values.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters