Skip to content

Commit

Permalink
chore: call /rollout endpoint in deploy github action (NangoHQ#3161)
Browse files Browse the repository at this point in the history
Calling the /rollout endpoint when deploying runner via github action.
I've tested in staging:
https://github.com/NangoHQ/nango/actions/runs/12300905315
  • Loading branch information
TBonnin authored Dec 12, 2024
1 parent 0d139d2 commit 575fc05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,16 @@ jobs:
API_KEY: ${{ secrets.RENDER_API_KEY }}
ENVIRONMENT: ${{ inputs.stage }}
RUNNER_OWNER_ID: ${{ secrets.RENDER_RUNNER_OWNER_ID }}
INTERNAL_API_KEY: ${{ inputs.stage == 'production' && secrets.PROD_INTERNAL_API_KEY || secrets.STAGING_INTERNAL_API_KEY }}
run: |
bash ./scripts/deploy/runners.bash
NANGO_API_HOSTNAME=${{ fromJson('{ "production": "api.nango.dev", "staging": "api-staging.nango.dev" }')[inputs.stage] }}
curl -sS --fail-with-body --request POST "https://$NANGO_API_HOSTNAME/internal/fleet/nango_runners/rollout" \
--header "authorization: Bearer $INTERNAL_API_KEY"\
--header "content-type: application/json"\
--data "{ \"commitHash\": \"${{ github.sha }}\" }"
deploy_persist:
if: inputs.service == 'persist'
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy/runners.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ while true; do
continue
fi
name=$(echo "$item" | jq -r '.service.name' 2>/dev/null)
if [[ "$name" != "$ENVIRONMENT-runner-"* ]]; then
if [[ ! "$name" =~ ^$ENVIRONMENT-runner-account-(default|[0-9]+)$ ]]; then
continue
fi

Expand Down

0 comments on commit 575fc05

Please sign in to comment.