Skip to content

Commit

Permalink
Add persist API
Browse files Browse the repository at this point in the history
The goal is to remove the database dependency for the runner.
Writing customers data (batchSave/.../activityLogs/lastSyncDate) will go
through this API
  • Loading branch information
TBonnin committed Jan 30, 2024
1 parent b6227e7 commit 2da6a86
Show file tree
Hide file tree
Showing 23 changed files with 1,216 additions and 52 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ concurrency:
group: pulls/${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
nango-persist:
uses: ./.github/workflows/push-container.yaml
secrets: inherit
with:
package: persist
run-cmd: ts-build
tags: -t nangohq/nango-persist:$GITHUB_SHA ${{ github.ref == 'refs/heads/master' && '-t nangohq/nango-persist:enterprise-$GITHUB_SHA -t nangohq/nango-persist:enterprise -t nangohq/nango-persist:hosted-$GITHUB_SHA -t nangohq/nango-persist:hosted' || '' }}
nango-jobs:
uses: ./.github/workflows/push-container.yaml
secrets: inherit
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
- server
- jobs
- runner
- persist

jobs:
deploy_server:
Expand Down Expand Up @@ -76,4 +77,20 @@ jobs:
RUNNER_OWNER_ID: ${{ secrets.RENDER_RUNNER_OWNER_ID }}
run: |
bash ./scripts/deploy/runners.bash
depoy_persist:
if: inputs.service == 'persist'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push tag
run: |
docker buildx imagetools create nangohq/nango-persist:${{ github.sha }} --tag nangohq/nango-persist:${{ inputs.stage }}
- name: Deploy persist
run: |
SERVICE_ID=${{ fromJson('{ production: "srv-XXXXXXXXXXXXX", staging: "srv-cmsfiqqcn0vc73bhcod0" }')[inputs.stage] }}
curl --request POST "https://api.render.com/v1/services/$SERVICE_ID/deploys" --header "authorization: Bearer ${{ secrets.RENDER_API_KEY }}"
Loading

0 comments on commit 2da6a86

Please sign in to comment.