@@ -24,3 +24,26 @@ jobs:
|
|||||||
cp -r dist/. ~/apps/hub/dist/
|
cp -r dist/. ~/apps/hub/dist/
|
||||||
chmod +x ~/apps/hub/hub-api ~/apps/hub/scripts/*
|
chmod +x ~/apps/hub/hub-api ~/apps/hub/scripts/*
|
||||||
systemctl --user restart hub-api
|
systemctl --user restart hub-api
|
||||||
|
- name: Notify ok
|
||||||
|
if: success()
|
||||||
|
env:
|
||||||
|
WH_URL: ${{ secrets.WH_URL }}
|
||||||
|
WH_SECRET: ${{ secrets.WH_SECRET }}
|
||||||
|
REF: ${{ github.ref_name }}
|
||||||
|
run: |
|
||||||
|
BODY="$(jq -nc --arg t "✅ ${{ github.repository }}: деплой прошёл ($REF)" '{text:$t}')"
|
||||||
|
SIG="$(printf %s "$BODY" | openssl dgst -sha256 -hmac "$WH_SECRET" | awk '{print $2}')"
|
||||||
|
curl -fsS -X POST "$WH_URL" -H "Content-Type: application/json" \
|
||||||
|
-H "X-Hub-Signature-256: sha256=$SIG" -d "$BODY"
|
||||||
|
- name: Notify fail
|
||||||
|
if: failure()
|
||||||
|
env:
|
||||||
|
WH_URL: ${{ secrets.WH_URL }}
|
||||||
|
WH_SECRET: ${{ secrets.WH_SECRET }}
|
||||||
|
REF: ${{ github.ref_name }}
|
||||||
|
run: |
|
||||||
|
BODY="$(jq -nc --arg t "❌ ${{ github.repository }}: деплой наебнулся ($REF)" '{text:$t}')"
|
||||||
|
SIG="$(printf %s "$BODY" | openssl dgst -sha256 -hmac "$WH_SECRET" | awk '{print $2}')"
|
||||||
|
curl -fsS -X POST "$WH_URL" -H "Content-Type: application/json" \
|
||||||
|
-H "X-Hub-Signature-256: sha256=$SIG" -d "$BODY"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user