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