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
|
- name: Link Docker package to repository
|
||||||
run: |
|
run: |
|
||||||
# Wait a moment for the package to be registered
|
# Wait for package to be registered in Gitea
|
||||||
sleep 5
|
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 \
|
curl -X PUT \
|
||||||
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
-H "Authorization: token ${{ secrets.TOKEN }}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"repository_id": ${{ gitea.repository_id }}}' \
|
-d "{\"repository_id\": \"${{ gitea.repository_id }}\"}" \
|
||||||
"https://${{ env.REGISTRY }}/api/v1/packages/${{ gitea.repository_owner }}/container/${{ steps.repo.outputs.repository_name }}/link" || \
|
"https://${{ env.REGISTRY }}/api/v1/packages/${{ gitea.repository_owner }}/container/${{ steps.repo.outputs.repository_name }}/repository" \
|
||||||
echo "⚠️ Package linking failed, but package should still be available"
|
-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
|
- name: Link package to repository
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user