mirror of
https://github.com/icereed/paperless-gpt.git
synced 2025-03-12 21:08:00 -05:00
Refactor Docker image tagging logic
This commit is contained in:
parent
199e1413ba
commit
fcbc392e67
1 changed files with 12 additions and 5 deletions
17
.github/workflows/docker-build-and-push.yml
vendored
17
.github/workflows/docker-build-and-push.yml
vendored
|
@ -68,6 +68,17 @@ jobs:
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set Docker tags
|
||||||
|
id: set_tags
|
||||||
|
run: |
|
||||||
|
echo "TAGS=icereed/paperless-gpt:unreleased" >> $GITHUB_ENV
|
||||||
|
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then
|
||||||
|
echo "TAGS=icereed/paperless-gpt:unreleased" >> $GITHUB_ENV
|
||||||
|
elif [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
|
||||||
|
VERSION=${GITHUB_REF#refs/tags/}
|
||||||
|
echo "TAGS=icereed/paperless-gpt:latest,icereed/paperless-gpt:${VERSION}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build and push Docker images
|
- name: Build and push Docker images
|
||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
|
@ -77,8 +88,4 @@ jobs:
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
tags: |
|
tags: ${{ env.TAGS }}
|
||||||
icereed/paperless-gpt:unreleased
|
|
||||||
${{ github.ref == 'refs/heads/main' && 'icereed/paperless-gpt:unreleased' }}
|
|
||||||
${{ github.ref_type == 'tag' && 'icereed/paperless-gpt:latest' }}
|
|
||||||
${{ github.ref_type == 'tag' && 'icereed/paperless-gpt:${{ github.ref_name }}' }}
|
|
Loading…
Reference in a new issue