Trigger deployment / empty commit #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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." |