Update worckflow
All checks were successful
Build and Push Docker Image (Simple) / build-and-push (push) Successful in 14s

This commit is contained in:
jafreli
2025-07-19 01:38:26 +02:00
parent 1871bb8d1f
commit 727a9f9b9b

View File

@@ -45,38 +45,41 @@ jobs:
run: |
docker push ${{ env.REGISTRY }}/${{ steps.repo.outputs.repository_lower }}/${{ steps.repo.outputs.repository_name }}:latest
- name: Debug and link package
- name: Link package to repository
run: |
echo "🔍 Debugging package registration..."
echo "Expected package path: ${{ steps.repo.outputs.repository_name }}"
echo "Full image path: ${{ env.REGISTRY }}/${{ steps.repo.outputs.repository_lower }}/${{ steps.repo.outputs.repository_name }}:latest"
echo "<EFBFBD> Libnking package to repository..."
echo "Package name: habittracker/habittracker"
echo "Repository: ${{ gitea.repository }}"
# Wait for package registration
sleep 20
sleep 10
# List all packages for the user to see what's actually there
echo "📦 Listing all packages for user ${{ gitea.repository_owner }}:"
curl -s -H "Authorization: token ${{ secrets.TOKEN }}" \
"https://${{ env.REGISTRY }}/api/v1/packages/${{ gitea.repository_owner }}" || echo "Failed to list packages"
# Link the package using the correct API endpoint and package name
echo "<EFBFBD> LAttempting to link package..."
RESPONSE=$(curl -s -w "%{http_code}" \
-X PUT \
-H "Authorization: token ${{ secrets.TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"repository": "${{ gitea.repository }}"}' \
"https://${{ env.REGISTRY }}/api/v1/packages/${{ gitea.repository_owner }}/container/habittracker%2Fhabittracker")
# Try to find the package with different names
echo "🔍 Trying different package names..."
HTTP_CODE="${RESPONSE: -3}"
RESPONSE_BODY="${RESPONSE%???}"
# Try with full repository name
echo "Checking: ${{ steps.repo.outputs.repository_lower }}"
curl -s -w "HTTP: %{http_code}\n" -H "Authorization: token ${{ secrets.TOKEN }}" \
"https://${{ env.REGISTRY }}/api/v1/packages/${{ gitea.repository_owner }}/container/${{ steps.repo.outputs.repository_lower }}" || true
echo "HTTP Status: $HTTP_CODE"
echo "Response: $RESPONSE_BODY"
# Try with just repo name
echo "Checking: ${{ steps.repo.outputs.repository_name }}"
curl -s -w "HTTP: %{http_code}\n" -H "Authorization: token ${{ secrets.TOKEN }}" \
"https://${{ env.REGISTRY }}/api/v1/packages/${{ gitea.repository_owner }}/container/${{ steps.repo.outputs.repository_name }}" || true
echo "💡 If package exists but isn't linked, you can manually link it in the Gitea UI:"
echo " 1. Go to https://${{ env.REGISTRY }}/${{ gitea.repository_owner }}/packages"
echo " 2. Find your package"
if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "204" ]; then
echo "✅ Package successfully linked to repository!"
echo "🎉 Check your repository packages tab: https://${{ env.REGISTRY }}/${{ gitea.repository }}"
else
echo "⚠️ Automatic linking failed (HTTP $HTTP_CODE)"
echo "💡 Manual linking instructions:"
echo " 1. Go to: https://${{ env.REGISTRY }}/${{ gitea.repository_owner }}/packages"
echo " 2. Find package: habittracker/habittracker"
echo " 3. Click 'Link to Repository'"
echo " 4. Select your repository: ${{ gitea.repository }}"
echo " 4. Select: ${{ gitea.repository }}"
fi
- name: Link package to repository
run: |