From 1f888b2f6c8ab227d0e9e38ca7c256b7af3606c3 Mon Sep 17 00:00:00 2001 From: Trishnak-K Date: Tue, 8 Oct 2024 15:21:47 +0530 Subject: [PATCH 1/3] Added Build pipeline --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..54e8001 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: Build on PR + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' # Pin the Node.js version + + - name: Cache node_modules + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install Dependencies + run: npm install + + - name: Run Build + run: npm run build From e355a20340c7c0338e2c1a54b3cd3c639546fff9 Mon Sep 17 00:00:00 2001 From: Trishnak-K Date: Tue, 8 Oct 2024 15:23:40 +0530 Subject: [PATCH 2/3] Added docker Ignore --- .dockerIgnore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .dockerIgnore diff --git a/.dockerIgnore b/.dockerIgnore new file mode 100644 index 0000000..977fe1d --- /dev/null +++ b/.dockerIgnore @@ -0,0 +1,8 @@ +node_modules +.git +.gitignore +.env.example +.env +.next +.vercel +.github \ No newline at end of file From 2131490211367b2dd4290b48e3cf4684382e03d4 Mon Sep 17 00:00:00 2001 From: Trishnak-K Date: Tue, 8 Oct 2024 15:24:39 +0530 Subject: [PATCH 3/3] Added Docker File --- Dockerfile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0719ba4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM node:20-alpine + +# Set working directory +WORKDIR /src + +# Copy package.json and lock file +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the application code +COPY . . + +# Build the application +RUN npm run build + +# Expose the application port +EXPOSE 3000 + +# Start the application +CMD ["npm", "run", "start"]