Skip to content

Commit

Permalink
Add Publish netconf-simulator
Browse files Browse the repository at this point in the history
Signed-off-by: tobias.pobocik <[email protected]>
  • Loading branch information
Tobianas committed Dec 6, 2024
1 parent 68ef87d commit e104a90
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/publish-simulator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish netconf-simulator
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:
IMAGE-NAME: "lighty-netconf-simulator"
PUBLISH_ACCESS_KEY: ${{ secrets.MM_PKG_WRITE }}
name: "Publish netconf-simulator docker image. Checkout-ref: ${{ github.event.inputs.checkout-ref }}"
steps:
- name: Tag image
shell: bash
run: |
image_name=$(mvn help:evaluate -f ${{ inputs.app-docker-pom-path }} -Dexpression=image.name -q -DforceStdout)
docker tag $image_name $DOCKER_IMAGE_NAME_TAG
if [ "${{ inputs.image-tag-latest }}" = 'true' ]; then
docker tag $image_name $DOCKER_IMAGE_NAME:latest
fi
docker images | grep $image_name
- name: List docker images
shell: bash
run: |
docker images
- name: Docker log in (ghcr.io)
shell: bash
run: |
echo ${{ inputs.publish-access-key}} | docker login --username ${{ github.actor }} --password-stdin ghcr.io
- name: Publish docker image (ghcr.io)
shell: bash
run: |
docker push $DOCKER_IMAGE_NAME_TAG
if [ "${{ inputs.image-tag-latest }}" = 'true' ]; then
docker push $DOCKER_IMAGE_NAME:latest
fi

0 comments on commit e104a90

Please sign in to comment.