Skip to content

Trigger deployment / empty commit #14

Trigger deployment / empty commit

Trigger deployment / empty commit #14

name: Deploy
on:
push:
branches:
- deploy-to-rush-admin
jobs:
send_webhook:
runs-on: ubuntu-latest
steps:
- name: Send Webhook
id: request # for reference when checking response status
env:
URL: ${{ secrets.RUSH_DEPLOY_WEBHOOK_URL_PYTHON_DEPLOYER }}
SECRET: ${{ secrets.RUSH_DEPLOY_WEBHOOK_SECRET }}
run: |
BODY='{}'
TIMESTAMP=$(date +%s)
SIGNATURE=$(echo -n "$TIMESTAMP$BODY" | openssl dgst -sha256 -hmac "$SECRET" | cut -d " " -f2)
response=$(curl -X POST $URL \
-H "Content-Type: application/json" \
-H "X-Timestamp: $TIMESTAMP" \
-H "X-Signature: $SIGNATURE" \
-d "$BODY")
echo "Response: $response"
status=$(echo "$response" | jq -r '.success')
echo "status=$status" >> $GITHUB_OUTPUT
- name: Check response
run: |
if [ "${{ steps.request.outputs.status }}" != true ]; then
echo "Deployment failed with status=${{ steps.request.outputs.status }}"
exit 1
fi
echo "Deployment succeeded."