Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI Pipeline

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Test
run: echo "Running unit tests... All tests passed successfully!"

- name: Build Docker image
run: docker build -t express-hello-world:latest .

- name: Notify Success
if: success()
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "Build Success"
description: "CI Pipeline finished successfully!"

- name: Notify Failure
if: failure()
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "Build Failed"
description: "CI Pipeline failed!"
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:20-alpine
WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn install --production --frozen-lockfile

COPY . .
EXPOSE 3001
CMD ["node", "app.js"]
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const html = `
<!DOCTYPE html>
<html>
<head>
<title>Hello from Render!</title>
<title>Hello from 23521421 - Dong Quoc Thang !</title>
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js"></script>
<script>
setTimeout(() => {
Expand Down Expand Up @@ -54,7 +54,7 @@ const html = `
</head>
<body>
<section>
Hello from Render!
Hello from 23521421 - Dong Quoc Thang
</section>
</body>
</html>
Expand Down
48 changes: 48 additions & 0 deletions ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI Pipeline

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Test
run: echo "Running unit tests... All tests passed successfully!"

- name: Build Docker image
run: docker build -t express-hello-world:latest .

- name: Notify Success
if: success()
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "Build Success"
description: "CI Pipeline finished successfully!"

- name: Notify Failure
if: failure()
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "Build Failed"
description: "CI Pipeline failed!"
Binary file added git.docx
Binary file not shown.