Skip to content

Commit

Permalink
trigger preview images on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk committed May 1, 2024
1 parent 372adfe commit a1ad984
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/preview-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ on:
- Tests
types:
- completed
branches:
- master

env:
DOCKER_REPO: redash

jobs:
build-skip-check:
runs-on: ubuntu-22.04
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.conclusion == 'success' && (endsWith(github.event.workflow_run.head_branch, '-dev') || startsWith(github.event.workflow_run.head_branch, 'master')) }}
outputs:
skip: ${{ steps.skip-check.outputs.skip }}
steps:
Expand Down Expand Up @@ -71,7 +69,12 @@ jobs:
run: |
set -x
VERSION=$(jq -r .version package.json)
FULL_VERSION=${VERSION}-b${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}
BRANCH=${{ event.workflow_run.head_branch }}
if [[ "$BRANCH" =~ ^[0-9]+\.[0-9]+\.[0-9]+\-dev ]]; then
FULL_VERSION=${VERSION}
else
FULL_VERSION=${VERSION}-b${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}
fi
sed -ri "s/^__version__ = ([A-Za-z0-9.-]*)'/__version__ = '${FULL_VERSION}'/" redash/__init__.py
sed -i "s/dev/${GITHUB_SHA}/" client/app/version.json
echo "VERSION_TAG=$FULL_VERSION" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit a1ad984

Please sign in to comment.