Skip to content

Commit

Permalink
Merge branch 'dev' into frontend/31/create-city
Browse files Browse the repository at this point in the history
  • Loading branch information
sonm0002 committed Aug 23, 2024
2 parents ed03dd0 + 53cf569 commit 0d7fe5b
Show file tree
Hide file tree
Showing 46 changed files with 10,214 additions and 1,498 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
file: ./backend/Dockerfile.prod
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/backend:latest

Expand All @@ -35,6 +35,6 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ./frontend
file: ./frontend/Dockerfile
file: ./frontend/Dockerfile.prod
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/frontend:latest
13 changes: 13 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@ jobs:

- name: Go to frontend and run tests
run: cd frontend && npm i && npm run test

test-back:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Go to backend and run tests
run: cd backend && npm i && npm run test
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}


4 changes: 2 additions & 2 deletions .github/workflows/staging-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# generate some credentials from Dockerhub and store them into the repo secrets
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# prepare buildx for docker
- uses: docker/setup-buildx-action@v1
name: Set up Docker Buildx
Expand All @@ -39,6 +39,6 @@ jobs:
name: Build and push
with:
context: ./backend
file: ./backend/Dockerfile
file: ./backend/Dockerfile.prod
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_BACKEND_IMAGE_NAME }}:latest
4 changes: 2 additions & 2 deletions .github/workflows/staging-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# generate some credentials from Dockerhub and store them into the repo secrets
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# prepare buildx for docker
- uses: docker/setup-buildx-action@v1
name: Set up Docker Buildx
Expand All @@ -38,6 +38,6 @@ jobs:
name: Build and push
with:
context: ./frontend
file: ./frontend/Dockerfile
file: ./frontend/Dockerfile.prod
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_FRONTEND_IMAGE_NAME }}:latest
4 changes: 2 additions & 2 deletions .github/workflows/staging-imagesupload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# generate some credentials from Dockerhub and store them into the repo secrets
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# prepare buildx for docker
- uses: docker/setup-buildx-action@v1
name: Set up Docker Buildx
Expand All @@ -39,6 +39,6 @@ jobs:
name: Build and push
with:
context: ./imagesupload
file: ./backend/Dockerfile
file: ./imagesupload/Dockerfile.prod
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_IMAGESUPLOAD_IMAGE_NAME }}:latest
6 changes: 3 additions & 3 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#secret key for hash
SECRET_KEY=

#mapbox secret key api
MAPBOX_API_KEY=

#google api key
GOOGLE_API_KEY=

#database
DATABASE_USERNAME=
DATABASE_PASSWORD=

#environment
NODE_ENV=
2 changes: 1 addition & 1 deletion backend/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ COPY --from=builder /app/dist/ /app/dist/

COPY package.json package.json
RUN npm install --omit-dev

ENV NODE_ENV=production
CMD npm run startprod
9 changes: 9 additions & 0 deletions backend/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
module.exports = {
testEnvironment: "node",
transform: {
"^.+.tsx?$": ["ts-jest",{}],
},
setupFiles: ["<rootDir>/jest.setup.ts"],
moduleDirectories: ['node_modules', '<rootDir>/src'],
};
4 changes: 4 additions & 0 deletions backend/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import dotenv from "dotenv";
import "reflect-metadata";

dotenv.config();
Loading

0 comments on commit 0d7fe5b

Please sign in to comment.