🐛(ci) use github action for argocd webhook notification
In order to refactor this notification between alls projetcs, we chooseto use a custom github action
This commit is contained in:
15
.github/workflows/docker-hub.yml
vendored
15
.github/workflows/docker-hub.yml
vendored
@@ -118,12 +118,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
steps:
|
steps:
|
||||||
-
|
- uses: numerique-gouv/action-argocd-webhook-notification@main
|
||||||
name: Checkout repository
|
id: notify
|
||||||
uses: actions/checkout@v4
|
with:
|
||||||
-
|
deployment_repo_path: "${{ secrets.DEPLOYMENT_REPO_URL }}"
|
||||||
name: Call argocd github webhook
|
argocd_webhook_secret: "${{ secrets.ARGOCD_PREPROD_WEBHOOK_SECRET }}"
|
||||||
run: |
|
argocd_url: "${{ vars.ARGOCD_PREPROD_WEBHOOK_URL }}"
|
||||||
data='{"ref": "'$GITHUB_REF'","repository": {"html_url":"'$GITHUB_SERVER_URL'/numerique-gouv/lasuite-deploiement"}}'
|
|
||||||
sig=$(echo -n ${data} | openssl dgst -sha256 -hmac "${{ secrets.ARGOCD_PREPROD_WEBHOOK_SECRET }}" | awk '{print "X-Hub-Signature-256: sha256="$2}')
|
|
||||||
curl -X POST -H 'X-GitHub-Event:push' -H "Content-Type: application/json" -H "${sig}" --data "${data}" ${{ vars.ARGOCD_PREPROD_WEBHOOK_URL }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user