Skip to content

Publish RNC docker image and helm charts #24

Publish RNC docker image and helm charts

Publish RNC docker image and helm charts #24

Workflow file for this run

name: Publish RNC 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-rnc-app,:lighty-rnc-app-docker,:lighty-rnc-module"
APP-DOCKER-POM-PATH: "lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-app-docker/pom.xml"
APP-HELM-FOLDER-PATH: "lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-app-helm/helm/"
APP-HELM-VALUES-PATH: "lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-app-helm/helm/lighty-rnc-app-helm/values.yaml"
IMAGE-NAME: "lighty-rnc"
PUBLISH_ACCESS_KEY: ${{ secrets.MM_PKG_WRITE }}
name: "Publish RNC 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 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- 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 RNC 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 RNC 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 }}