Remove Dokploy webhook from workflow
All checks were successful
Build and deploy Backend / build (push) Successful in 41s
All checks were successful
Build and deploy Backend / build (push) Successful in 41s
This commit is contained in:
@@ -12,7 +12,6 @@ jobs:
|
|||||||
SERVICE_NAME: backend
|
SERVICE_NAME: backend
|
||||||
IMAGE_SHA: gitea.dsrptlab.com/mapflow/backend:${{ github.sha }}
|
IMAGE_SHA: gitea.dsrptlab.com/mapflow/backend:${{ github.sha }}
|
||||||
IMAGE_LATEST: gitea.dsrptlab.com/mapflow/backend:latest
|
IMAGE_LATEST: gitea.dsrptlab.com/mapflow/backend:latest
|
||||||
DOKPLOY_DEPLOY_WEBHOOK: http://sin.dsrptlab.com:3000/api/deploy/x3IYnQHykbR__LYwh0LPH
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -34,32 +33,6 @@ jobs:
|
|||||||
docker buildx inspect --bootstrap
|
docker buildx inspect --bootstrap
|
||||||
docker buildx build --push --provenance=false --tag "$IMAGE_SHA" --tag "$IMAGE_LATEST" .
|
docker buildx build --push --provenance=false --tag "$IMAGE_SHA" --tag "$IMAGE_LATEST" .
|
||||||
|
|
||||||
- name: Skip stale deployment
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
latest_sha="$(git ls-remote origin refs/heads/main | awk '{print $1}')"
|
|
||||||
if [ "$latest_sha" = "${GITHUB_SHA}" ]; then
|
|
||||||
touch .deploy-current
|
|
||||||
else
|
|
||||||
echo "A newer main commit exists: $latest_sha. Skipping deploy for ${GITHUB_SHA}."
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Trigger Dokploy webhook
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
[ -f .deploy-current ] || exit 0
|
|
||||||
payload=$(cat <<JSON
|
|
||||||
{"ref":"refs/heads/main","after":"$GITHUB_SHA","commits":[{"id":"$GITHUB_SHA","message":"$SERVICE_NAME #${GITHUB_RUN_NUMBER:-0} ${GITHUB_SHA:0:7}"}]}
|
|
||||||
JSON
|
|
||||||
)
|
|
||||||
response_file="$(mktemp)"
|
|
||||||
status_code="$(curl -sS -o "$response_file" -w "%{http_code}" -X POST "$DOKPLOY_DEPLOY_WEBHOOK" \
|
|
||||||
-H "x-gitea-event: push" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "$payload")"
|
|
||||||
cat "$response_file"
|
|
||||||
[ "$status_code" = "200" ]
|
|
||||||
|
|
||||||
- name: Prune shared BuildKit cache
|
- name: Prune shared BuildKit cache
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|||||||
Reference in New Issue
Block a user