Skip to content

Commit

Permalink
fix: Added a GH Action for updating the Convex Functions
Browse files Browse the repository at this point in the history
  • Loading branch information
FleetAdmiralJakob committed Feb 1, 2024
1 parent 1716b7d commit b1a7786
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/update-city-data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy to Convex

on:
push:
branches: ["main"]
merge_group:

# You can leverage Vercel Remote Caching with Turbo to speed up your builds
# @link https://turborepo.org/docs/core-concepts/remote-caching#remote-caching-on-vercel-builds
env:
FORCE_COLOR: 3
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}

jobs:
update-city-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup

- name: Deploy to convex
run: pnpm convex:deploy
env:
CONVEX_URL: ${{ secrets.CONVEX_URL }}
CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint:ws": "pnpm dlx sherif@latest",
"postinstall": "pnpm lint:ws",
"typecheck": "turbo typecheck",
"update:city-data": "cd packages/city-data && pnpm update:city-data && pnpm push:city-data",
"convex:deploy": "cd packages/city-data && pnpm update:city-data && pnpm convex:deploy",
"e2e:test": "turbo e2e:test"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/city-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"lint": "eslint .",
"typecheck": "tsc --noEmit",
"update:city-data": "cd src && node download.mjs && node convert.mjs && node renamejsonproperties.mjs && node createJSONL.mjs",
"push:city-data": " convex import --table search src/city-list.jsonl --replace",
"build": "convex deploy"
"convex:deploy": " convex import --table search src/city-list.jsonl --replace && convex deploy"
},
"eslintConfig": {
"root": true,
Expand Down
4 changes: 3 additions & 1 deletion packages/city-data/src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ cities1000.zip
cities.json
DE.txt
DE.zip
DE.json
DE.json
city-list.json
city-list.jsonl
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@
"TEST_MODE",
"NEXT_PUBLIC_CONVEX_URL",
"CONVEX_DEPLOY_KEY"
],
"globalPassThroughEnv": [
"CONVEX_URL"
]
}

0 comments on commit b1a7786

Please sign in to comment.