Skip to content

Commit

Permalink
merge :: CD (#12)
Browse files Browse the repository at this point in the history
* add :: dockerfile, CD

* chore :: codeformat
  • Loading branch information
jyk1029 authored Feb 29, 2024
1 parent 3a3a6a9 commit a1dfbde
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Dockerfile
node_modules
npm-debug.log
dist
22 changes: 22 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CD

on:
push:
branches: [ 'main' ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login Docker
env:
DOCKER_USERNAME: ${{secrets.DOCKERHUB_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD

- name: Build Docker Image
run: docker build -t jyk1029/emoting .

- name: Push Docker Image
run: docker push jyk1029/emoting:latest
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:18-alpine

WORKDIR /app
ADD . /app/

RUN npm install
RUN npm run build

EXPOSE 8080
ENTRYPOINT npm run start

0 comments on commit a1dfbde

Please sign in to comment.