prevent pre-releases from triggering image build

This commit is contained in:
hackerESQ
2025-05-02 20:07:38 -05:00
committed by GitHub
parent de54b6843d
commit 80b043219a
+12 -6
View File
@@ -43,7 +43,16 @@ jobs:
- name: Extract version from tag - name: Extract version from tag
id: extract-version id: extract-version
run: | run: |
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV VERSION="${GITHUB_REF_NAME#v}"
TAGS="investbrainapp/investbrain:${VERSION},ghcr.io/investbrainapp/investbrain:${VERSION}"
# Conditionally add 'latest' tags unless 'pre-release' is in the version
if [[ "${GITHUB_REF_NAME}" != *alpha* && "${GITHUB_REF_NAME}" != *beta* && "${GITHUB_REF_NAME}" != *rc* ]]; then
TAGS="$TAGS,investbrainapp/investbrain:latest,ghcr.io/investbrainapp/investbrain:latest"
fi
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Build and push - name: Build and push
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
@@ -51,8 +60,5 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
file: ./docker/Dockerfile file: ./docker/Dockerfile
push: true push: true
tags: | tags: ${{ steps.extract-version.outputs.tags }}
investbrainapp/investbrain:latest
investbrainapp/investbrain:${{ env.version }}
ghcr.io/investbrainapp/investbrain:latest
ghcr.io/investbrainapp/investbrain:${{ env.version }}