File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 4141 secrets :
4242 DISCORD_WEBHOOK : ${{ secrets.DISCORD_WEBHOOK }}
4343 EZLOCALAI_URI : ${{ secrets.EZLOCALAI_URI }}
44- EZLOCALAI_API_KEY : ${{ secrets.EZLOCALAI_API_KEY }}
44+ EZLOCALAI_API_KEY : ${{ secrets.EZLOCALAI_API_KEY }}
45+ deploy :
46+ runs-on : ubuntu-22.04
47+ name : Deploy to dev server
48+ needs : build
49+ if : github.ref == 'refs/heads/main'
50+ steps :
51+ - name : Deploy Application
52+ id : deploy
53+ run : |
54+ RESPONSE=$(curl -s -w "\nHTTP_STATUS_CODE:%{http_code}" -X POST "${{ secrets.DEPLOY_URI }}" \
55+ -H "Content-Type: application/json" \
56+ -H "X-API-Key: ${{ secrets.DEPLOY_SECRET }}" \
57+ -d '{"domain": "${{ secrets.DEPLOY_DOMAIN }}"}')
58+
59+ HTTP_STATUS=$(echo "$RESPONSE" | grep -o "HTTP_STATUS_CODE:[0-9]*" | cut -d: -f2)
60+ RESPONSE_BODY=$(echo "$RESPONSE" | sed '/HTTP_STATUS_CODE:/d')
61+
62+ echo "deploy_response=$RESPONSE_BODY" >> $GITHUB_OUTPUT
63+ echo "deploy_status=$HTTP_STATUS" >> $GITHUB_OUTPUT
64+
65+ if [ "$HTTP_STATUS" -ge 200 ] && [ "$HTTP_STATUS" -lt 300 ]; then
66+ echo "Deployment successful with status $HTTP_STATUS"
67+ else
68+ echo "Deployment failed with status $HTTP_STATUS"
69+ exit 1
70+ fi
You can’t perform that action at this time.
0 commit comments