.gitea/workflows/build-and-push.yaml aktualisiert
This commit is contained in:
1 parent
9bfbadd89b
commit
c1cf74e7f6
1 file changed
+11
-3
@@ -404,15 +404,20 @@ jobs:
|
|||||||
|
|
||||||
REPO_PURE="${{ steps.prep.outputs.repo_pure }}"
|
REPO_PURE="${{ steps.prep.outputs.repo_pure }}"
|
||||||
DH_USER="${{ secrets.DOCKERHUB_USERNAME }}"
|
DH_USER="${{ secrets.DOCKERHUB_USERNAME }}"
|
||||||
|
GITEA_URL="${{ steps.prep.outputs.image_name }}"
|
||||||
|
DH_URL="${DH_USER}/${REPO_PURE}"
|
||||||
|
|
||||||
SHORT_DESC=$(echo -e "${{ env.DESCRIPTION }}" | head -n 1 | cut -c 1-100)
|
SHORT_DESC=$(echo -e "${{ env.DESCRIPTION }}" | head -n 1 | cut -c 1-100)
|
||||||
[ -z "$SHORT_DESC" ] && SHORT_DESC="Docker Image for $REPO_PURE"
|
[ -z "$SHORT_DESC" ] && SHORT_DESC="Docker Image for $REPO_PURE"
|
||||||
|
|
||||||
echo "📦 Processing README.md (${REPO_PURE})..."
|
echo "📦 Processing README.md for Docker Hub (${DH_URL})..."
|
||||||
|
|
||||||
|
# Erstelle temporäre README für Docker Hub, in der die Gitea-URL durch den Docker Hub Image-Namen ersetzt wird
|
||||||
|
sed "s|${GITEA_URL}|${DH_URL}|g" README.md > README_DH.md
|
||||||
|
|
||||||
jq -n \
|
jq -n \
|
||||||
--arg desc "$SHORT_DESC" \
|
--arg desc "$SHORT_DESC" \
|
||||||
--rawfile full_desc README.md \
|
--rawfile full_desc README_DH.md \
|
||||||
'{description: $desc, full_description: $full_desc}' > payload.json
|
'{description: $desc, full_description: $full_desc}' > payload.json
|
||||||
|
|
||||||
echo "📤 Sending data to Docker Hub API..."
|
echo "📤 Sending data to Docker Hub API..."
|
||||||
@@ -426,13 +431,16 @@ jobs:
|
|||||||
BODY=$(echo "$RESPONSE" | head -n -1)
|
BODY=$(echo "$RESPONSE" | head -n -1)
|
||||||
|
|
||||||
if [ "$HTTP_STATUS" -eq 200 ]; then
|
if [ "$HTTP_STATUS" -eq 200 ]; then
|
||||||
echo "✅ README update successfull (HTTP 200)."
|
echo "✅ README update successful (HTTP 200)."
|
||||||
else
|
else
|
||||||
echo "❌ Error on update! HTTP Status: $HTTP_STATUS"
|
echo "❌ Error on update! HTTP Status: $HTTP_STATUS"
|
||||||
echo "Answer from Docker Hub: $BODY"
|
echo "Answer from Docker Hub: $BODY"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Temporäre Datei aufräumen
|
||||||
|
rm -f README_DH.md
|
||||||
|
|
||||||
- name: Commit, Tag and Push Changes
|
- name: Commit, Tag and Push Changes
|
||||||
if: steps.check_changes.outputs.should_build == 'true'
|
if: steps.check_changes.outputs.should_build == 'true'
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in new issue
Block a user