feat: Add support for a testing and unstable branch (#495)

* feat(ci): Add support for a testing branch

* feat(ci): Add support for an unstable branch

* fix(ci): Use github ref name for determining the branch name
This commit is contained in:
RJ Trujillo 2023-11-01 12:25:24 -06:00 committed by GitHub
parent 08fe8d661e
commit 941a3a64e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,8 @@ on:
push:
branches:
- main
- testing
- unstable
paths-ignore:
- '**.md'
- '**.txt'
@ -23,7 +25,7 @@ on:
merge_group:
workflow_dispatch:
env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
jobs:
push-ghcr:
@ -116,11 +118,24 @@ jobs:
COMMIT_TAGS+=("${SHA_SHORT}")
fi
BUILD_TAGS=("${MAJOR_VERSION}" "${MAJOR_VERSION}-${TIMESTAMP}")
if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
[[ "${{ matrix.is_stable_version }}" == "true" ]]; then
BUILD_TAGS+=("latest")
if [[ ${{ github.ref_name }} == "unstable" ]]; then
BUILD_TAGS=("${MAJOR_VERSION}-unstable" "${MAJOR_VERSION}-unstable-${TIMESTAMP}")
if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
[[ "${{ matrix.is_stable_version }}" == "true" ]]; then
BUILD_TAGS+=("unstable")
fi
elif [[ ${{ github.ref_name }} == "testing" ]]; then
BUILD_TAGS=("${MAJOR_VERSION}-testing" "${MAJOR_VERSION}-testing-${TIMESTAMP}")
if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
[[ "${{ matrix.is_stable_version }}" == "true" ]]; then
BUILD_TAGS+=("testing")
fi
else
BUILD_TAGS=("${MAJOR_VERSION}" "${MAJOR_VERSION}-${TIMESTAMP}")
if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
[[ "${{ matrix.is_stable_version }}" == "true" ]]; then
BUILD_TAGS+=("latest")
fi
fi
if [[ "${{ github.event_name }}" == "pull_request" ]]; then