18
18
with :
19
19
node-version : 18
20
20
21
- - name : Install npm
21
+ - name : Install npm dependencies
22
22
run : npm install
23
23
24
-
25
- - name : Setting up Variables
26
- env :
27
- MONGO_URI : ${{ secrets.MONGO_URI }}
28
- SERVERLESS_ACCESS_KEY : ${{ secrets.SERVERLESS_ACCESS_KEY }}
29
-
30
-
31
24
- name : Configure AWS Credentials
32
25
uses : aws-actions/configure-aws-credentials@v2
33
26
with :
@@ -39,11 +32,23 @@ jobs:
39
32
run : npx eslint . # Stops the deployment if there are linting errors
40
33
41
34
- name : Install only production dependencies
42
- run : npm ci --only=production # only production dependencies are deployed
43
-
35
+ run : npm ci --only=production # Only production dependencies are deployed
44
36
45
- - name : Deploy with Serverless
46
-
37
+ - name : Install Serverless Framework
38
+ run : |
39
+
40
+ serverless --version # Debugging: Check installed version
41
+
42
+ - name : Create .env file
47
43
run : |
44
+ echo "MONGO_URI=${{ secrets.MONGO_URI }}" >> .env
45
+ echo "SERVERLESS_ACCESS_KEY=${{ secrets.SERVERLESS_ACCESS_KEY }}" >> .env
48
46
echo "MONGO_URI is set to $MONGO_URI" # Debugging: Print the MONGO_URI value
49
- serverless deploy --verbose
47
+ cat .env # Show file contents
48
+
49
+ - name : Deploy with Serverless
50
+ env :
51
+ MONGO_URI : ${{ secrets.MONGO_URI }}
52
+ SERVERLESS_ACCESS_KEY : ${{ secrets.SERVERLESS_ACCESS_KEY }}
53
+ run : serverless deploy --verbose
54
+
0 commit comments