Update worckflow
Some checks failed
Build and Push Docker Image (Simple) / build-and-push (push) Failing after 44s
Some checks failed
Build and Push Docker Image (Simple) / build-and-push (push) Failing after 44s
This commit is contained in:
@@ -47,16 +47,33 @@ jobs:
|
||||
|
||||
- name: Link Docker package to repository
|
||||
run: |
|
||||
# Wait a moment for the package to be registered
|
||||
sleep 5
|
||||
# Wait for package to be registered in Gitea
|
||||
echo "⏳ Waiting for package registration..."
|
||||
sleep 15
|
||||
|
||||
# Link the package to the repository using Gitea API
|
||||
# Get package information to verify it exists
|
||||
echo "🔍 Checking if package exists..."
|
||||
PACKAGE_EXISTS=$(curl -s -H "Authorization: token ${{ secrets.TOKEN }}" \
|
||||
"https://${{ env.REGISTRY }}/api/v1/packages/${{ gitea.repository_owner }}/container/${{ steps.repo.outputs.repository_name }}" \
|
||||
| jq -r '.name // "not_found"')
|
||||
|
||||
if [ "$PACKAGE_EXISTS" != "not_found" ]; then
|
||||
echo "✅ Package found: $PACKAGE_EXISTS"
|
||||
|
||||
# Try to link package to repository using the correct API
|
||||
echo "🔗 Linking package to repository..."
|
||||
curl -X PUT \
|
||||
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"repository_id": ${{ gitea.repository_id }}}' \
|
||||
"https://${{ env.REGISTRY }}/api/v1/packages/${{ gitea.repository_owner }}/container/${{ steps.repo.outputs.repository_name }}/link" || \
|
||||
echo "⚠️ Package linking failed, but package should still be available"
|
||||
-d "{\"repository_id\": \"${{ gitea.repository_id }}\"}" \
|
||||
"https://${{ env.REGISTRY }}/api/v1/packages/${{ gitea.repository_owner }}/container/${{ steps.repo.outputs.repository_name }}/repository" \
|
||||
-w "\nHTTP Status: %{http_code}\n" || echo "⚠️ API linking failed"
|
||||
|
||||
echo "✅ Package linking completed"
|
||||
else
|
||||
echo "❌ Package not found yet - it may take a few minutes to appear"
|
||||
echo "💡 The package should automatically link due to the Docker labels"
|
||||
fi
|
||||
|
||||
- name: Link package to repository
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user