add hantim.net
Deploy hantim.net / deploy (push) Failing after 1s
Deploy nginx / deploy (push) Failing after 1s

This commit is contained in:
2026-03-16 18:09:23 -04:00
parent 544fb9c13f
commit 8a30405d18
4 changed files with 96 additions and 2 deletions
+19 -2
View File
@@ -276,10 +276,27 @@ git push
# --- Trigger initial build ---
echo "==> Triggering initial build for $APP..."
curl -sf -X POST "$GITEA_URL/api/v1/repos/$GITEA_ORG/$APP/contents/.deploy-trigger" \
TRIGGER_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
-X POST "$GITEA_URL/api/v1/repos/$GITEA_ORG/$APP/contents/.deploy-trigger" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"content\": \"$(echo -n "initial deploy" | base64)\", \"message\": \"trigger initial build\"}" > /dev/null
-d "{\"content\": \"$(echo -n "initial deploy" | base64)\", \"message\": \"trigger initial build\"}")
if [ "$TRIGGER_CODE" = "201" ]; then
echo " Build triggered."
elif [ "$TRIGGER_CODE" = "422" ]; then
# File already exists — update it to trigger a new build
EXISTING_SHA=$(curl -s "$GITEA_URL/api/v1/repos/$GITEA_ORG/$APP/contents/.deploy-trigger" \
-H "Authorization: token $GITEA_TOKEN" | jq -r '.sha')
curl -s -o /dev/null -X PUT "$GITEA_URL/api/v1/repos/$GITEA_ORG/$APP/contents/.deploy-trigger" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"content\": \"$(echo -n "redeploy $(date +%s)" | base64)\", \"sha\": \"$EXISTING_SHA\", \"message\": \"trigger rebuild\"}"
echo " Build re-triggered (file already existed)."
else
echo " Warning: Could not trigger build (HTTP $TRIGGER_CODE). Check manually:"
echo " $GITEA_URL/$GITEA_ORG/$APP/actions"
fi
# --- Verify ---