Skip to content

Commit bde8436

Browse files
committed
chore: add GitHub Actions workflow for deployment to server
1 parent b897179 commit bde8436

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy To Server
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: "20"
16+
17+
- name: Deploy to Server
18+
uses: appleboy/[email protected]
19+
with:
20+
host: ${{secrets.SERVER_HOST}}
21+
key: ${{secrets.SERVER_SSH_KEY}}
22+
username: ${{secrets.SERVER_USERNAME}}
23+
script: |
24+
cd /var/www/micah-code-error-integration-telex
25+
# Stash changes to prevent conflicts
26+
git stash
27+
git pull https://github.com/telexintegrations/code-error-microservice main
28+
npm install
29+
export NODE_OPTIONS="--max-old-space-size=4096"
30+
npm run start:prod
31+
echo "Deployment to Server Completed"

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import "./services/zeromqService";
33
import { ENV_CONFIG } from "./utils/envConfig";
44

55
app.listen(ENV_CONFIG.PORT, () => {
6-
console.log(`Microservice running on port ${ENV_CONFIG.PORT}`);
6+
console.log(`Microservice running on http://localhost:${ENV_CONFIG.PORT}`);
77
});

0 commit comments

Comments
 (0)