-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from boostcampwm2023/BE-develop
develop ๋ธ๋์น ๋ฐ์
- Loading branch information
Showing
105 changed files
with
4,240 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: BE-deploy | ||
on: | ||
push: | ||
branches: | ||
- "BE-develop" | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: BE-develop | ||
sparse-checkout: nestjs-BE | ||
- name: Login to github Packages | ||
run: echo ${{ secrets.PACKAGE_ACCESS_TOKEN }} | docker login ghcr.io -u ${{ secrets.PACKAGE_USERNAME }} --password-stdin | ||
- name: Build and push Docker image | ||
run: | | ||
echo "SERVER_PORT=$SERVER_PORT" >> ./nestjs-BE/server/.env | ||
echo "JWT_ACCESS_SECRET=$JWT_ACCESS_SECRET" >> ./nestjs-BE/server/.env | ||
echo "JWT_REFRESH_SECRET=$JWT_REFRESH_SECRET" >> ./nestjs-BE/server/.env | ||
echo "KAKAO_ADMIN_KEY=$KAKAO_ADMIN_KEY" >> ./nestjs-BE/server/.env | ||
echo "MYSQL_DATABASE_URL=$MYSQL_DATABASE_URL" >> ./nestjs-BE/server/.env | ||
echo "MONGODB_DATABASE_URL=$MONGODB_DATABASE_URL" >> ./nestjs-BE/server/.env | ||
echo "MONGODB_DATABASE_URI=$MONGODB_DATABASE_URI" >> ./nestjs-BE/server/.env | ||
echo "NCLOUD_ACCESS_KEY=$NCLOUD_ACCESS_KEY" >> ./nestjs-BE/server/.env | ||
echo "NCLOUD_SECRET_KEY=$NCLOUD_SECRET_KEY" >> ./nestjs-BE/server/.env | ||
echo "NCLOUD_REGION=$NCLOUD_REGION" >> ./nestjs-BE/server/.env | ||
echo "STORAGE_URL=$STORAGE_URL" >> ./nestjs-BE/server/.env | ||
echo "BASE_IMAGE_URL=$BASE_IMAGE_URL" >> ./nestjs-BE/server/.env | ||
echo "BUCKET_NAME=$BUCKET_NAME" >> ./nestjs-BE/server/.env | ||
echo "APP_ICON_URL=$APP_ICON_URL" >> ./nestjs-BE/server/.env | ||
echo "CSV_FOLDER=$CSV_FOLDER" >> ./nestjs-BE/server/.env | ||
docker build -t ghcr.io/${{ secrets.PACKAGE_USERNAME }}/mindsync ./nestjs-BE/server | ||
docker push ghcr.io/${{ secrets.PACKAGE_USERNAME }}/mindsync:latest | ||
env: | ||
SERVER_PORT: ${{ secrets.CONTAINER_PORT }} | ||
JWT_ACCESS_SECRET: ${{ secrets.JWT_ACCESS_SECRET }} | ||
JWT_REFRESH_SECRET: ${{ secrets.JWT_REFRESH_SECRET }} | ||
KAKAO_ADMIN_KEY: ${{ secrets.KAKAO_ADMIN_KEY }} | ||
MYSQL_DATABASE_URL: ${{ secrets.MYSQL_DATABASE_URL }} | ||
MONGODB_DATABASE_URL: ${{ secrets.MONGODB_DATABASE_URL }} | ||
MONGODB_DATABASE_URI: ${{ secrets.MONGODB_DATABASE_URI }} | ||
NCLOUD_ACCESS_KEY: ${{ secrets.NCLOUD_ACCESS_KEY }} | ||
NCLOUD_SECRET_KEY: ${{ secrets.NCLOUD_SECRET_KEY }} | ||
NCLOUD_REGION: ${{ secrets.NCLOUD_REGION }} | ||
STORAGE_URL: ${{ secrets.STORAGE_URL }} | ||
BASE_IMAGE_URL: ${{ secrets.BASE_IMAGE_URL }} | ||
BUCKET_NAME: ${{ secrets.BUCKET_NAME }} | ||
APP_ICON_URL: ${{ secrets.APP_ICON_URL }} | ||
CSV_FOLDER: ${{ secrets.CSV_FOLDER }} | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Pull Docker image | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.REMOTE_HOST }} | ||
port: ${{ secrets.REMOTE_PORT }} | ||
username: ${{ secrets.REMOTE_USER }} | ||
key: ${{ secrets.REMOTE_SSH_KEY }} | ||
script: | | ||
echo ${{ secrets.PACKAGE_ACCESS_TOKEN }} | docker login ghcr.io -u ${{ secrets.PACKAGE_USERNAME }} --password-stdin | ||
docker pull ghcr.io/${{ secrets.PACKAGE_USERNAME }}/mindsync | ||
docker stop mindsync_server || true | ||
docker rm mindsync_server || true | ||
docker run -d \ | ||
--name mindsync_server \ | ||
-p ${{ secrets.SERVER_PORT }}:${{ secrets.CONTAINER_PORT }} \ | ||
-v temporary-volume:${{ secrets.CSV_FOLDER }} \ | ||
ghcr.io/${{ secrets.PACKAGE_USERNAME }}/mindsync |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
README.md | ||
/test | ||
|
||
.eslintrc.js | ||
.gitignore | ||
.prettierrc | ||
nest-cli.json | ||
|
||
*.spec.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM node:20.4.0-alpine | ||
|
||
WORKDIR /server | ||
|
||
COPY package.json package-lock.json ./ | ||
|
||
RUN npm ci | ||
|
||
COPY ./ ./ | ||
|
||
RUN npx prisma generate --schema=./prisma/mysql.schema.prisma | ||
|
||
RUN npx prisma generate --schema=./prisma/mongodb.schema.prisma | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["npm", "start"] |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.