Skip to content

Commit b582c51

Browse files
Update deploy.yml
1 parent e231dd3 commit b582c51

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

.github/workflows/deploy.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,9 @@ jobs:
1818
with:
1919
node-version: 18
2020

21-
- name: Install npm
21+
- name: Install npm dependencies
2222
run: npm install
2323

24-
25-
- name: Setting up Variables
26-
env:
27-
MONGO_URI: ${{ secrets.MONGO_URI }}
28-
SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }}
29-
30-
3124
- name: Configure AWS Credentials
3225
uses: aws-actions/configure-aws-credentials@v2
3326
with:
@@ -39,11 +32,23 @@ jobs:
3932
run: npx eslint . # Stops the deployment if there are linting errors
4033

4134
- 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
4436

45-
- name: Deploy with Serverless
46-
37+
- name: Install Serverless Framework
38+
run: |
39+
npm install -g [email protected]
40+
serverless --version # Debugging: Check installed version
41+
42+
- name: Create .env file
4743
run: |
44+
echo "MONGO_URI=${{ secrets.MONGO_URI }}" >> .env
45+
echo "SERVERLESS_ACCESS_KEY=${{ secrets.SERVERLESS_ACCESS_KEY }}" >> .env
4846
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

Comments
 (0)