Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-fleming committed Jan 8, 2025
1 parent 799f906 commit be3444c
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,26 @@ jobs:
uses: actions/checkout@v2

- name: Set Image Tag
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
# Get all tags for the repo and find the latest tag for the branch being built
git fetch --tags --force --quiet
tag=$(git tag -l $GITHUB_REF_NAME* | tail -1 | cut -d "-" -f2-)
if [ ! -z "$tag" ];
then
# Increment the build number if a tag is found
build_num=$(echo "${tag##*.}")
build_num=$((build_num+1))
echo "IMAGE_TAG=$GITHUB_REF_NAME.$build_num" >> $GITHUB_ENV
else
# If no tag is found create a new tag name
build_num=1
echo "IMAGE_TAG=$GITHUB_REF_NAME.$build_num" >> $GITHUB_ENV
fi
# tag=$(git tag -l $GITHUB_REF_NAME* | tail -1 | cut -d "-" -f2-)
build_num=$(git tag -l $BRANCH_NAME* | tail -1 | cut -d "-" -f2-)
((build_num++))
echo "IMAGE_TAG=$GITHUB_REF_NAME.$build_num" >> $GITHUB_ENV
# if [ ! -z "$tag" ];
# then
# # Increment the build number if a tag is found
# build_num=$(echo "${tag##*.}")
# build_num=$((build_num+1))
# echo "IMAGE_TAG=$GITHUB_REF_NAME.$build_num" >> $GITHUB_ENV
# else
# # If no tag is found create a new tag name
# build_num=1
# echo "IMAGE_TAG=$GITHUB_REF_NAME.$build_num" >> $GITHUB_ENV
# fi
- name: Build
id: build-image
Expand Down

0 comments on commit be3444c

Please sign in to comment.