Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workaround with forelast version HEAD #93

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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