From 51211c1c8578ee2cd9bad6cd4ff1392e72be431e Mon Sep 17 00:00:00 2001 From: minseonjae Date: Thu, 8 May 2025 16:20:42 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20=EB=8F=84=EC=BB=A4=20=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20=EB=B9=8C=EB=93=9C=20=EC=95=A1=EC=85=98=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 22 ++++++++++++++++++++++ dockerfile | 15 +++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 dockerfile diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f538ee7 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,22 @@ +name: Docker Publish +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Docker 이미지 빌드 + run: docker build -t seaproject/my-app:latest . + + - name: Docker Hub에 로그인 + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Docker 이미지 푸시 + run: docker push seaproject/my-app:latest \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..bb4c0bc --- /dev/null +++ b/dockerfile @@ -0,0 +1,15 @@ +FROM node:18-alpine + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +RUN npm run build + +EXPOSE 3000 + +CMD [ "npm", "start" ] \ No newline at end of file