Compare commits
20
Commits
501760e176
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54c8082eaa | ||
|
|
1254a0b9d9 | ||
|
|
5fc7ec864c | ||
|
|
a12b3e5a68 | ||
|
|
dd22d02945 | ||
|
|
fd95bf52ae | ||
|
|
b657ba0215 | ||
|
|
8435b42778 | ||
|
|
86dc1fa2a8 | ||
|
|
c5c6f45d58 | ||
|
|
33e025f278 | ||
|
|
7f3303e3a8 | ||
|
|
d8d961cf5d | ||
|
|
c03afc1ddc | ||
|
|
75d64c9111 | ||
|
|
659f16ba7c | ||
|
|
4ce386f613 | ||
|
|
5a3f1ccec8 | ||
|
|
1c87975602 | ||
|
|
5e13563b1d |
@@ -0,0 +1,49 @@
|
|||||||
|
name: Node.js CI/CD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check Git
|
||||||
|
shell: powershell
|
||||||
|
run: git --version
|
||||||
|
|
||||||
|
- name: Check Node.js
|
||||||
|
shell: powershell
|
||||||
|
run: node --version
|
||||||
|
|
||||||
|
- name: Check npm
|
||||||
|
shell: powershell
|
||||||
|
run: npm --version
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
shell: powershell
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Check application
|
||||||
|
shell: powershell
|
||||||
|
run: node --check app.js
|
||||||
|
|
||||||
|
- name: Deploy application
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
$deployPath = "D:\apps\my_temp\my-node-app"
|
||||||
|
|
||||||
|
if (!(Test-Path $deployPath)) {
|
||||||
|
New-Item -ItemType Directory -Path $deployPath -Force
|
||||||
|
}
|
||||||
|
|
||||||
|
Copy-Item -Path ".\*" -Destination $deployPath -Recurse -Force
|
||||||
|
|
||||||
|
pm2 restart my-node-app
|
||||||
|
|
||||||
|
Write-Host "Deployment completed successfully."
|
||||||
@@ -15,6 +15,7 @@ const server = http.createServer((req, res) => {
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Hello from Node.js!</h1>
|
<h1>Hello from Node.js!</h1>
|
||||||
|
<h1>CI-CD1</h1>
|
||||||
<p>Welcome, This application is running on Windows 10.</p>
|
<p>Welcome, This application is running on Windows 10.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Generated
+13
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"name": "my-node-app",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "my-node-app",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "ISC"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "my-node-app",
|
"name": "my-node-app",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"main": "index.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"start": "node app.js"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user