Installation sudo apt install webhookshCopy Mise en place Création d'un endpoint: rules.json[ { "id": name, "execute-command": deploy.sh, "command-working-directory": working directory, "pass-arguments-to-command": [ { "source": "payload", "name": "head_commit.message" }, { "source": "payload", "name": "pusher.name" }, { "source": "payload", "name": "head_commit.id" } ], "trigger-rule": { "and": [ { "match": { "type": "payload-hash-sha1", "secret": github secret, "parameter": { "source": "header", "name": "X-Hub-Signature" } } }, { "match": { "type": "value", "value": "refs/heads/main", "parameter": { "source": "payload", "name": "ref" } } } ] } } ]jsonCopy Création du script d'automatisation: deploy.sh#!/bin/sh git pull -f origin branch npm install npm run build pm2 restart appnameshCopy Lancement du serveur webhook webhook -hooks hooks.json -port portshCopy nging/site-enabled/server_nameserver { listen 443 ssl http2; listen [::]:443 ssl http2; server_name server_name location /hooks/ { proxy_pass http://localhost:port/hooks/; } }shCopy