Skip to content

Commit 28f03f8

Browse files
committed
feat: upgrade to Node.js v22 and standardize environment variables
- Update GitHub Actions workflow to use Node.js v22 - Update package.json engines to require Node.js v22 - Standardize Google Maps API key naming (GOOGLE_MAPS_API_KEY) - Standardize LINODE_USERNAME in deployment workflow
1 parent a63c9a0 commit 28f03f8

File tree

3 files changed

+100
-96
lines changed

3 files changed

+100
-96
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ USPS_CONSUMER_KEY=your_usps_consumer_key_here
55
USPS_CONSUMER_SECRET=your_usps_consumer_secret_here
66

77
# Google Maps API Configuration
8-
GMAPS_API_KEY=your_google_maps_api_key_here
8+
GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here
99

1010
# Server Configuration (optional)
1111
PORT=3715

.github/workflows/node.js.yml

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,112 @@
11
name: Build and Deploy
22

33
on:
4-
push:
5-
branches:
6-
- master
4+
push:
5+
branches:
6+
- master
77

88
jobs:
9-
build:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- name: Checkout Repository
13-
uses: actions/checkout@v3
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v3
1414

15-
- name: Setup Node.js
16-
uses: actions/setup-node@v3
17-
with:
18-
node-version: '16'
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '22'
1919

20-
- name: Install Dependencies
21-
run: npm ci
20+
- name: Install Dependencies
21+
run: npm ci
2222

23-
- name: Build Project
24-
run: npm run build
23+
- name: Build Project
24+
run: npm run build
2525

26-
- name: Upload Build Artifact
27-
uses: actions/upload-artifact@v4
28-
with:
29-
name: build-files
30-
path: |
31-
dist
32-
ecosystem.config.js
33-
package.json
34-
package-lock.json
26+
- name: Upload Build Artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: build-files
30+
path: |
31+
dist
32+
ecosystem.config.js
33+
package.json
34+
package-lock.json
3535
36-
deploy:
37-
needs: build
38-
runs-on: ubuntu-latest
39-
steps:
40-
- name: Download Build Artifact
41-
uses: actions/download-artifact@v4
42-
with:
43-
name: build-files
44-
path: build-files
36+
deploy:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Download Build Artifact
41+
uses: actions/download-artifact@v4
42+
with:
43+
name: build-files
44+
path: build-files
4545

46-
- name: List downloaded artifact
47-
run: ls -la build-files
46+
- name: List downloaded artifact
47+
run: ls -la build-files
4848

49-
- name: Ensure target directory exists on Linode
50-
uses: appleboy/ssh-action@master
51-
with:
52-
host: ${{ secrets.LINODE_HOST }}
53-
username: ${{ secrets.LINODE_USER }}
54-
key: ${{ secrets.LINODE_SSH_KEY }}
55-
script: |
56-
mkdir -p /home/puppeteer-user/candycomp-location-correction
49+
- name: Ensure target directory exists on Linode
50+
uses: appleboy/ssh-action@master
51+
with:
52+
host: ${{ secrets.LINODE_HOST }}
53+
username: ${{ secrets.LINODE_USERNAME }}
54+
key: ${{ secrets.LINODE_SSH_KEY }}
55+
script: |
56+
mkdir -p /home/puppeteer-user/candycomp-location-correction
5757
58-
- name: Copy Build Files to Linode Server
59-
uses: appleboy/scp-action@master
60-
with:
61-
host: ${{ secrets.LINODE_HOST }}
62-
username: ${{ secrets.LINODE_USER }}
63-
key: ${{ secrets.LINODE_SSH_KEY }}
64-
source: 'build-files/.'
65-
target: '/home/puppeteer-user/candycomp-location-correction/'
66-
strip_components: 1
58+
- name: Copy Build Files to Linode Server
59+
uses: appleboy/scp-action@master
60+
with:
61+
host: ${{ secrets.LINODE_HOST }}
62+
username: ${{ secrets.LINODE_USERNAME }}
63+
key: ${{ secrets.LINODE_SSH_KEY }}
64+
source: 'build-files/.'
65+
target: '/home/puppeteer-user/candycomp-location-correction/'
66+
strip_components: 1
6767

68-
- name: Create .env file on Linode
69-
uses: appleboy/ssh-action@master
70-
with:
71-
host: ${{ secrets.LINODE_HOST }}
72-
username: ${{ secrets.LINODE_USER }}
73-
key: ${{ secrets.LINODE_SSH_KEY }}
74-
script: |
75-
cat <<'EOF' > /home/puppeteer-user/candycomp-location-correction/.env
76-
PORT=${{ secrets.PORT }}
77-
GMAPS_API_KEY=${{ secrets.GMAPS_API_KEY }}
78-
USPS_TOKEN_URL=${{ secrets.USPS_TOKEN_URL }}
79-
USPS_ADDRESS_URL=${{ secrets.USPS_ADDRESS_URL }}
80-
USPS_CONSUMER_KEY=${{ secrets.USPS_CONSUMER_KEY }}
81-
USPS_CONSUMER_SECRET=${{ secrets.USPS_CONSUMER_SECRET }}
82-
NODE_ENV=production
83-
EOF
68+
- name: Create .env file on Linode
69+
uses: appleboy/ssh-action@master
70+
with:
71+
host: ${{ secrets.LINODE_HOST }}
72+
username: ${{ secrets.LINODE_USERNAME }}
73+
key: ${{ secrets.LINODE_SSH_KEY }}
74+
script: |
75+
cat <<'EOF' > /home/puppeteer-user/candycomp-location-correction/.env
76+
PORT=${{ secrets.PORT }}
77+
GOOGLE_MAPS_API_KEY=${{ secrets.GOOGLE_MAPS_API_KEY }}
78+
USPS_TOKEN_URL=${{ secrets.USPS_TOKEN_URL }}
79+
USPS_ADDRESS_URL=${{ secrets.USPS_ADDRESS_URL }}
80+
USPS_CONSUMER_KEY=${{ secrets.USPS_CONSUMER_KEY }}
81+
USPS_CONSUMER_SECRET=${{ secrets.USPS_CONSUMER_SECRET }}
82+
NODE_ENV=production
83+
EOF
8484
85-
- name: List deployment directory contents
86-
uses: appleboy/ssh-action@master
87-
with:
88-
host: ${{ secrets.LINODE_HOST }}
89-
username: ${{ secrets.LINODE_USER }}
90-
key: ${{ secrets.LINODE_SSH_KEY }}
91-
script: 'ls -la /home/puppeteer-user/candycomp-location-correction/'
85+
- name: List deployment directory contents
86+
uses: appleboy/ssh-action@master
87+
with:
88+
host: ${{ secrets.LINODE_HOST }}
89+
username: ${{ secrets.LINODE_USERNAME }}
90+
key: ${{ secrets.LINODE_SSH_KEY }}
91+
script: 'ls -la /home/puppeteer-user/candycomp-location-correction/'
9292

93-
- name: Install Node Modules on Linode
94-
uses: appleboy/ssh-action@master
95-
with:
96-
host: ${{ secrets.LINODE_HOST }}
97-
username: ${{ secrets.LINODE_USER }}
98-
key: ${{ secrets.LINODE_SSH_KEY }}
99-
script: |
100-
cd /home/puppeteer-user/candycomp-location-correction
101-
npm ci
93+
- name: Install Node Modules on Linode
94+
uses: appleboy/ssh-action@master
95+
with:
96+
host: ${{ secrets.LINODE_HOST }}
97+
username: ${{ secrets.LINODE_USERNAME }}
98+
key: ${{ secrets.LINODE_SSH_KEY }}
99+
script: |
100+
cd /home/puppeteer-user/candycomp-location-correction
101+
npm ci
102102
103-
- name: Start or Reload and Save PM2 Process on Linode
104-
uses: appleboy/ssh-action@master
105-
with:
106-
host: ${{ secrets.LINODE_HOST }}
107-
username: ${{ secrets.LINODE_USER }}
108-
key: ${{ secrets.LINODE_SSH_KEY }}
109-
script: |
110-
cd /home/puppeteer-user/candycomp-location-correction
111-
pm2 startOrReload ecosystem.config.js
112-
pm2 save
103+
- name: Start or Reload and Save PM2 Process on Linode
104+
uses: appleboy/ssh-action@master
105+
with:
106+
host: ${{ secrets.LINODE_HOST }}
107+
username: ${{ secrets.LINODE_USERNAME }}
108+
key: ${{ secrets.LINODE_SSH_KEY }}
109+
script: |
110+
cd /home/puppeteer-user/candycomp-location-correction
111+
pm2 startOrReload ecosystem.config.js
112+
pm2 save

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
"express"
2222
],
2323
"esModuleInterop": true,
24+
"engines": {
25+
"node": ">=22.0.0",
26+
"npm": ">=10.0.0"
27+
},
2428
"scripts": {
2529
"dev": "nodemon --watch src --ext ts,tsx --exec ts-node src/server.ts",
2630
"build": "tsc",

0 commit comments

Comments
 (0)