forked from PANTHEONtech/lighty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: tobias.pobocik <[email protected]>
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
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,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 |