fix: update Docker image tag logic for pull requests and tags (#177)

This commit is contained in:
Icereed 2025-02-03 09:39:57 +01:00 committed by GitHub
parent 78ecc12335
commit d8e673c1a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -215,6 +215,16 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set PAPERLESS_GPT_IMAGE
run: |
if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then
IMAGE="icereed/paperless-gpt:pr-${GITHUB_SHA}-amd64"
elif [ "${GITHUB_REF_TYPE}" = "tag" ]; then
IMAGE="icereed/paperless-gpt:${GITHUB_REF_NAME}-amd64"
else
IMAGE="icereed/paperless-gpt:unreleased-amd64"
fi
echo "PAPERLESS_GPT_IMAGE=${IMAGE}" >> $GITHUB_ENV
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
@ -230,7 +240,7 @@ jobs:
env: env:
CI: true CI: true
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PAPERLESS_GPT_IMAGE: icereed/paperless-gpt:pr-${{ github.sha }}-amd64 PAPERLESS_GPT_IMAGE: ${{ env.PAPERLESS_GPT_IMAGE }}
- name: Upload Playwright Report - name: Upload Playwright Report
if: always() if: always()
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4