🔧(ci) fix argocd notification

Argocd deployment use numerique-gouv/lasuite-deploiement as source so
the webhook need to tell argocd to refresh apps that use this repos
This commit is contained in:
Jacques ROUSSEL
2025-02-21 11:06:59 +01:00
committed by rouja
parent 9fc5681137
commit ccca2b9472

View File

@@ -117,8 +117,7 @@ jobs:
- build-and-push-backend - build-and-push-backend
- build-and-push-summary - build-and-push-summary
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: | if: github.event_name != 'pull_request'
github.event_name != 'pull_request'
steps: steps:
- -
name: Checkout repository name: Checkout repository
@@ -126,6 +125,6 @@ jobs:
- -
name: Call argocd github webhook name: Call argocd github webhook
run: | run: |
data='{"ref": "'$GITHUB_REF'","repository": {"html_url":"'$GITHUB_SERVER_URL'/'$GITHUB_REPOSITORY'"}}' data='{"ref": "'$GITHUB_REF'","repository": {"html_url":"'$GITHUB_SERVER_URL'/numerique-gouv/lasuite-deploiement"}}'
sig=$(echo -n ${data} | openssl dgst -sha1 -hmac "${{ secrets.ARGOCD_WEBHOOK_SECRET }}" | awk '{print "X-Hub-Signature: sha1="$2}') sig=$(echo -n ${data} | openssl dgst -sha1 -hmac "${{ secrets.ARGOCD_PREPROD_WEBHOOK_SECRET }}" | awk '{print "X-Hub-Signature: sha1="$2}')
curl -X POST -H 'X-GitHub-Event:push' -H "Content-Type: application/json" -H "${sig}" --data "${data}" ${{ vars.ARGOCD_PREPROD_WEBHOOK_URL }} curl -X POST -H 'X-GitHub-Event:push' -H "Content-Type: application/json" -H "${sig}" --data "${data}" ${{ vars.ARGOCD_PREPROD_WEBHOOK_URL }}