Skip to content

Publish RCgNMI docker image and helm charts #33

Publish RCgNMI docker image and helm charts

Publish RCgNMI docker image and helm charts #33

name: Publish RCgNMI docker image and helm charts
on:
workflow_dispatch:
inputs:
version:
description: Desired version of published docker image & helm charts, e.g. "XX.YY.ZZ"
required: true
checkout-ref:
description: The branch, tag or SHA to checkout. (if "default" the selected branch will be used)
default: default
required: true
image-tag-latest:
description: Should be this docker labeled with tag latest? Enter `true` if the tag `latest` should be added for image.
default: "true"
required: true
jobs:
publish-docker-helm:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
env:
APP-MODULES: ":lighty-rcgnmi-app,:lighty-rcgnmi-app-docker,:lighty-rcgnmi-app-module"
APP-DOCKER-POM-PATH: "lighty-applications/lighty-rcgnmi-app-aggregator/lighty-rcgnmi-app-docker/pom.xml"
APP-HELM-FOLDER-PATH: "lighty-applications/lighty-rcgnmi-app-aggregator/lighty-rcgnmi-app-helm/helm/"
APP-HELM-VALUES-PATH: "lighty-applications/lighty-rcgnmi-app-aggregator/lighty-rcgnmi-app-helm/helm/lighty-rcgnmi-app-helm/values.yaml"
IMAGE-NAME: "lighty-rcgnmi"
PUBLISH_ACCESS_KEY: ${{ secrets.MM_PKG_WRITE }}
name: "Publish RCgNMI docker image and helm charts. Checkout-ref: ${{ github.event.inputs.checkout-ref }}"
steps:
- name: Clone Repository
if: ${{ github.event.inputs.checkout-ref == 'default' }}
uses: actions/checkout@v2
- name: "Clone Repository, Ref: ${{ github.event.inputs.checkout-ref }}"
if: ${{ github.event.inputs.checkout-ref != 'default' }}
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.checkout-ref }}
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'temurin'
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.8
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: "Publish RcGNMI docker and prepare helm-charts"
uses: ./.github/workflows/publish-action
with:
app-modules: ${{ env.APP-MODULES }}
app-docker-pom-path: ${{ env.APP-DOCKER-POM-PATH }}
app-helm-values-path: ${{ env.APP-HELM-VALUES-PATH }}
image-name: ${{ env.IMAGE-NAME }}
version: ${{ github.event.inputs.version }}
image-tag-latest: ${{ github.event.inputs.image-tag-latest }}
publish-access-key: ${{ env.PUBLISH_ACCESS_KEY }}
- name: "Publish RCgNMI Helm chart to Helm repository (Version: ${{ github.event.inputs.version }} )"
if: ${{ github.event.inputs.version != '' }}
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ env.PUBLISH_ACCESS_KEY }}
charts_dir: ${{ env.APP-HELM-FOLDER-PATH }}
charts_url: https://pantheontech.github.io/helm-charts/
repository: helm-charts
branch: main
chart_version: ${{ github.event.inputs.version }}