Skip to content

Commit

Permalink
add havesine distance lib
Browse files Browse the repository at this point in the history
  • Loading branch information
leosantosw committed Jan 25, 2024
1 parent fd3d3c1 commit d6c16d7
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CD

on:
push:
branches:
- main
- develop

jobs:
cd:
name: CD
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Serverless credentials
run: |
mkdir ~/.aws && echo "${{ secrets.AWS_LAMBDA_PROFILES }}" > ~/.aws/credentials
- name: Install Dependencies
run: npm i

# Deploy in staging
- name: Deploy staging
if: github.ref == 'refs/heads/develop'
# [TODO]

# Deploy in production
- name: Deploy production
if: github.ref == 'refs/heads/main'
# [TODO]

8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"dev": "./scripts/start-local.sh",
"lint": "eslint ."
},
"dependencies": {
"pg": "8.11.3",
"haversine-distance": "1.2.1"
},
"devDependencies": {
"eslint": "8.32.0",
"eslint-config-standard": "17.0.0",
Expand All @@ -14,8 +18,5 @@
"eslint-plugin-promise": "6.1.1",
"serverless-offline": "12.0.4",
"serverless-prune-plugin": "2.0.1"
},
"dependencies": {
"pg": "8.11.3"
}
}
1 change: 1 addition & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ custom:
functions:
- ${file(./infra/lambda/list-customers.yml)}
- ${file(./infra/lambda/create-customer.yml)}
- ${file(./infra/lambda/nearby-customers.yml)}

resources:
- ${file(./infra/api-gateway/auth-response.yml)}
Expand Down

0 comments on commit d6c16d7

Please sign in to comment.