From d91cbce9dcf297df1a263c9f05af30f229de967e Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Sun, 14 Mar 2021 17:57:01 +0100 Subject: [PATCH] Patch workflow --- .github/workflows/workflow.yml | 2 +- action.yml | 27 ++++++++++++--------------- source/app/action/action.yml | 27 ++++++++++++--------------- 3 files changed, 25 insertions(+), 31 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7edb7e02..a5dc4df7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -119,7 +119,7 @@ jobs: dryrun: yes use_mocked_data: yes verify: yes - use_prebuilt_image: master + use_prebuilt_image: no # Build docker image from master and publish it to GitHub registry with release tag docker-release: diff --git a/action.yml b/action.yml index cb72da4f..3aae5bd7 100644 --- a/action.yml +++ b/action.yml @@ -959,24 +959,21 @@ runs: # Image name # Official action if [[ $METRICS_SOURCE == "lowlighter" ]]; then - # Is released version - set +e - METRICS_IS_RELEASED=$(expr $(expr match $METRICS_VERSION .*-beta) == 0) - set -e - echo "Is released version: $METRICS_IS_RELEASED" - # Use registry for released version - if [[ "$METRICS_IS_RELEASED" -gt "0" ]]; then - echo "Using released version $METRICS_TAG, will pull docker image from GitHub registry" + # Use registry with pre-built images + if [[ ! $METRICS_USE_PREBUILT_IMAGE =~ ^([Ff]alse|[Oo]ff|[Nn]o|0)$ ]]; then + # Is released version + set +e + METRICS_IS_RELEASED=$(expr $(expr match $METRICS_VERSION .*-beta) == 0) + set -e + echo "Is released version: $METRICS_IS_RELEASED" + if [[ "$METRICS_IS_RELEASED" -eq "0" ]]; then + METRICS_TAG="$METRICS_TAG-beta" + echo "Image tag (updated): $METRICS_TAG" + fi METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG - docker image pull $METRICS_IMAGE - # Use registry for unreleased version with pre-built images - elif [[ ! $METRICS_USE_PREBUILT_IMAGE =~ ^([Ff]alse|[Oo]ff|[Nn]o|0)$ ]]; then - METRICS_TAG="$METRICS_TAG-beta" - echo "Image tag (updated): $METRICS_TAG" echo "Using pre-built version $METRICS_TAG, will pull docker image from GitHub registry" - METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG docker image pull $METRICS_IMAGE - # Rebuild image for unreleased version + # Rebuild image else echo "Using an unreleased version ($METRICS_VERSION)" METRICS_IMAGE=metrics:$METRICS_VERSION diff --git a/source/app/action/action.yml b/source/app/action/action.yml index b8e36065..9d5140bc 100644 --- a/source/app/action/action.yml +++ b/source/app/action/action.yml @@ -56,24 +56,21 @@ runs: # Image name # Official action if [[ $METRICS_SOURCE == "lowlighter" ]]; then - # Is released version - set +e - METRICS_IS_RELEASED=$(expr $(expr match $METRICS_VERSION .*-beta) == 0) - set -e - echo "Is released version: $METRICS_IS_RELEASED" - # Use registry for released version - if [[ "$METRICS_IS_RELEASED" -gt "0" ]]; then - echo "Using released version $METRICS_TAG, will pull docker image from GitHub registry" + # Use registry with pre-built images + if [[ ! $METRICS_USE_PREBUILT_IMAGE =~ ^([Ff]alse|[Oo]ff|[Nn]o|0)$ ]]; then + # Is released version + set +e + METRICS_IS_RELEASED=$(expr $(expr match $METRICS_VERSION .*-beta) == 0) + set -e + echo "Is released version: $METRICS_IS_RELEASED" + if [[ "$METRICS_IS_RELEASED" -eq "0" ]]; then + METRICS_TAG="$METRICS_TAG-beta" + echo "Image tag (updated): $METRICS_TAG" + fi METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG - docker image pull $METRICS_IMAGE - # Use registry for unreleased version with pre-built images - elif [[ ! $METRICS_USE_PREBUILT_IMAGE =~ ^([Ff]alse|[Oo]ff|[Nn]o|0)$ ]]; then - METRICS_TAG="$METRICS_TAG-beta" - echo "Image tag (updated): $METRICS_TAG" echo "Using pre-built version $METRICS_TAG, will pull docker image from GitHub registry" - METRICS_IMAGE=ghcr.io/lowlighter/metrics:$METRICS_TAG docker image pull $METRICS_IMAGE - # Rebuild image for unreleased version + # Rebuild image else echo "Using an unreleased version ($METRICS_VERSION)" METRICS_IMAGE=metrics:$METRICS_VERSION