Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushing to production before adding more tables #22

Merged
merged 41 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
71f9e39
added /tracks GET request lambda handler
rtjord Oct 28, 2024
3839b86
updated handlers to use TypeScript compiled to commonjs
rtjord Oct 29, 2024
06f6cfa
updated deploy workflow to compile TypeScript to CommonJS before depl…
rtjord Oct 29, 2024
3e9abd0
updated gitignore
rtjord Oct 31, 2024
d0f5719
updated package.json
rtjord Nov 1, 2024
48d5e72
added aws-lambda types to package.json
rtjord Nov 1, 2024
209321f
Merge pull request #15 from rtjord/tracks
Tridentinus Nov 1, 2024
6cffd27
added production deployment
rtjord Nov 2, 2024
58c44ee
split deployments into separate workflows
rtjord Nov 2, 2024
39610ca
added linter and made suggested fixes
rtjord Nov 2, 2024
f10ea48
split tests into separate frontend and backend files
rtjord Nov 3, 2024
5752444
renamed test_backend to test_backend.yml
rtjord Nov 3, 2024
a1c8475
updated test_backend.yml
rtjord Nov 3, 2024
8300679
updated job names
rtjord Nov 3, 2024
63761db
updated job name
rtjord Nov 3, 2024
c66a664
install dependencies before deploying
rtjord Nov 3, 2024
d06feae
search bar update
pchhabr Nov 3, 2024
cf3df23
Merge pull request #17 from rtjord/prod-env
rtjord Nov 4, 2024
1dcd4ad
added lamda handler to get cost of package
rtjord Nov 4, 2024
ad9f4b4
added aws-sdk
rtjord Nov 4, 2024
be48d91
testing deploy_dev
rtjord Nov 4, 2024
6e5ddde
added aws-sdk/types
rtjord Nov 4, 2024
b0b1e5c
Fixed build issues
pchhabr Nov 4, 2024
189af4f
ensure clean install
rtjord Nov 4, 2024
8a35413
added aws-sdk types to tsconfig.json
rtjord Nov 4, 2024
4e8dd5e
updated package.json
rtjord Nov 5, 2024
9c1152f
updated template.yml to deploy to correct stage
rtjord Nov 5, 2024
1a5a085
testing deployment
rtjord Nov 5, 2024
9e37ed0
testing production deployment
rtjord Nov 5, 2024
2f23a43
Merge branch 'main', remote-tracking branch 'origin' into prod-env
rtjord Nov 5, 2024
793cd39
deploy_prod only runs on the main branch
rtjord Nov 5, 2024
66f71d3
Merge branch 'dev' into pulkit-frontend
rtjord Nov 5, 2024
3966ebe
Merge pull request #20 from rtjord/prod-env
Tridentinus Nov 5, 2024
3e46806
Merge branch 'dev' into pulkit-frontend
rtjord Nov 5, 2024
056dfbd
saving
rtjord Nov 6, 2024
b09a717
Merge remote-tracking branch 'origin' into cost
rtjord Nov 6, 2024
22ff361
Merge pull request #18 from rtjord/pulkit-frontend
Tridentinus Nov 6, 2024
1cb247f
implemented package cost get request with no dependencies
rtjord Nov 8, 2024
d344195
added dynamoDB read permissions to GetCost lambda function
rtjord Nov 8, 2024
a4036ab
Merge branch 'dev' into cost
rtjord Nov 8, 2024
87cf845
Merge pull request #21 from rtjord/cost
Tridentinus Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 0 additions & 73 deletions .github/workflows/build_test.yml

This file was deleted.

56 changes: 42 additions & 14 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,51 @@
name: Deploy Backend to Dev Environment
name: Deploy Backend to Development Environment

on:
push:
branches:
- dev

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: aws-actions/setup-sam@v2
- uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::122610496633:role/GitHubDeployRole
aws-region: us-east-2
- run: cd backend && sam build --use-container --template-file template.yml
- run: cd backend && sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --template-file template.yml
deploy-dev:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Sam CLI
uses: aws-actions/setup-sam@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: backend/node_modules
key: ${{ runner.os }}-backend-node-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-backend-node-

- name: Install dependencies
working-directory: backend
run: npm install

- name: Build
working-directory: backend
run: npm run build && sam build --use-container

- name: Configure AWS Credentials for Development Account
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::122610496633:role/GitHubDeployRole
aws-region: us-east-2

- name: Deploy to Development
working-directory: backend
run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --parameter-overrides Stage=dev
51 changes: 51 additions & 0 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy Backend to Production Environment

on:
push:
branches:
- main

permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
deploy-prod:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Sam CLI
uses: aws-actions/setup-sam@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: backend/node_modules
key: ${{ runner.os }}-backend-node-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-backend-node-

- name: Install dependencies
working-directory: backend
run: npm install

- name: Build
working-directory: backend
run: npm run build && sam build --use-container

- name: Configure AWS Credentials for Production Account
uses: aws-actions/[email protected]
with:
role-to-assume: arn:aws:iam::864899856155:role/GitHubDeployRole
aws-region: us-east-2

- name: Deploy to Production
working-directory: backend
run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --parameter-overrides Stage=prod
51 changes: 51 additions & 0 deletions .github/workflows/test_backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Test Backend

on:
pull_request:
branches:
- main
- dev

permissions:
contents: read
actions: read
repository-projects: read
issues: read
pull-requests: read

jobs:
test-backend:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: backend/node_modules
key: ${{ runner.os }}-backend-node-${{ hashFiles('backend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-backend-node-

- name: Install dependencies
working-directory: backend
run: npm install

- name: Lint Backend
working-directory: backend
run: npm run lint

- name: Run Backend Tests
working-directory: backend
run: npm run test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOG_FILE: test.log
LOG_LEVEL: 2
54 changes: 54 additions & 0 deletions .github/workflows/test_frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Test Frontend

on:
pull_request:
branches:
- main
- dev

permissions:
contents: read
actions: read

jobs:
test-frontend:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: frontend/node_modules
key: ${{ runner.os }}-frontend-node-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-frontend-node-

- name: Install dependencies
working-directory: frontend
run: npm install

- name: Lint
working-directory: frontend
run: npm run lint

- name: Cache Next.js build
uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/frontend/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('frontend/package-lock.json') }}-${{ hashFiles('frontend/**/*.{js,jsx,ts,tsx}') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('frontend/package-lock.json') }}-

- name: Build
working-directory: frontend
run: npm run build
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ amplify_outputs*
amplifyconfiguration*
node_modules/

.aws-sam
.aws-sam
coverage/
14 changes: 14 additions & 0 deletions backend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";


/** @type {import('eslint').Linter.Config[]} */
export default [
{files: ["**/*.{js,mjs,cjs,ts}"]},
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}},
{languageOptions: { globals: globals.browser }},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{ignores: ["**/node_modules/**", "**/dist/**", "**/build/**"]},
];
Loading
Loading