fix(ci): image tag was empty on scheduled runs (#2)
Co-authored-by: claude <[email protected]>
This commit was merged in pull request #2.
This commit is contained in:
@@ -30,7 +30,7 @@ concurrency:
|
||||
env:
|
||||
REGISTRY_PUSH: 192.168.0.2:1234
|
||||
REGISTRY_PULL: git.jpaul.io
|
||||
IMAGE: ${{ github.repository_owner }}/${{ github.event.repository.name }}
|
||||
IMAGE: ${{ github.repository }}
|
||||
OLLAMA_URL: http://192.168.0.2:11434,http://192.168.0.2:11435,http://192.168.0.125:11434
|
||||
EMBED_MODEL: nomic-embed-text
|
||||
PRODUCT_NAME: crop_chem
|
||||
@@ -46,6 +46,19 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Verify image name resolves
|
||||
# ${{ github.event.repository.name }} silently resolves to EMPTY on
|
||||
# schedule events (Gitea >=1.27), which built the tag
|
||||
# "192.168.0.2:1234/<owner>/:latest" and failed the build only AFTER
|
||||
# the full scrape. IMAGE now comes from github.repository; this step
|
||||
# fails in seconds if it ever goes empty again.
|
||||
run: |
|
||||
echo "IMAGE=${IMAGE}"
|
||||
case "${IMAGE}" in
|
||||
*/?*) ;;
|
||||
*) echo "ERROR: IMAGE did not resolve to owner/repo"; exit 1 ;;
|
||||
esac
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
@@ -88,7 +101,7 @@ jobs:
|
||||
GITEA_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||
run: |
|
||||
OWNER="${{ github.repository_owner }}"
|
||||
PKG="${{ github.event.repository.name }}"
|
||||
PKG="${GITHUB_REPOSITORY##*/}"
|
||||
BODY=$(mktemp)
|
||||
CODE=$(curl -sS -o "$BODY" -w "%{http_code}" -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
@@ -112,6 +125,6 @@ jobs:
|
||||
run: |
|
||||
python scripts/registry_gc.py \
|
||||
--owner "${{ github.repository_owner }}" \
|
||||
--package "${{ github.event.repository.name }}" \
|
||||
--package "${GITHUB_REPOSITORY##*/}" \
|
||||
--keep-days 180 \
|
||||
--keep-latest 6
|
||||
|
||||
Reference in New Issue
Block a user