Skip to content

Commit

Permalink
Merge pull request #94 from bkd-mba-fbi/test-ci
Browse files Browse the repository at this point in the history
Test ci
  • Loading branch information
kaeptnegli authored Sep 15, 2023
2 parents a2312f5 + f8c8ac2 commit 4b2879f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:

outputs:
version: ${{ steps.extract-version.outputs.version }}
version-forelast: ${{ steps.extract-version-forelast.outputs.version }}
branch: ${{ steps.extract-branch.outputs.branch }}

steps:
Expand All @@ -40,6 +41,12 @@ jobs:
git fetch --prune --tags
echo "version=`git tag -l --points-at=HEAD | sed -En 's/^v(.*)/\1/p'`" >> $GITHUB_OUTPUT
- name: Get version tag of HEAD~1 if any
id: extract-version-forelast
run: |
git fetch --prune --tags
echo "version-forelast=`git tag -l --points-at=HEAD~1 | sed -En 's/^v(.*)/\1/p'`" >> $GITHUB_OUTPUT
- name: Extract branch name
id: extract-branch
shell: bash
Expand All @@ -51,7 +58,7 @@ jobs:
build-and-push-image:
runs-on: ubuntu-latest
needs: prerequisites
if: github.event.pull_request.merged == true && needs.prerequisites.outputs.version == ''
if: github.event.pull_request.merged == true && needs.prerequisites.outputs.version == '' && needs.prerequisites.outputs.version-forelast == ''

strategy:
matrix:
Expand Down Expand Up @@ -118,7 +125,7 @@ jobs:
retag-and-push-image:
runs-on: ubuntu-latest
needs: prerequisites
if: github.event.pull_request.merged == true && needs.prerequisites.outputs.version != ''
if: github.event.pull_request.merged == true && needs.prerequisites.outputs.version-forelast != ''

steps:
- name: Login to Docker registry
Expand Down

0 comments on commit 4b2879f

Please sign in to comment.