Skip to content

Commit ef15919

Browse files
authored
Update main_backendcodecrib.yml
1 parent 33ef91e commit ef15919

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed
Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1-
name: Deploy Node.js Backend from /backend to Azure
1+
name: Deploy Backend to Azure
22

33
on:
44
push:
55
branches:
6-
- main
6+
- main # or your deployment branch
77

88
jobs:
99
build-and-deploy:
1010
runs-on: ubuntu-latest
1111

12-
defaults:
13-
run:
14-
working-directory: ./backend # <-- Important to tell it to work inside backend
15-
1612
steps:
17-
- name: Checkout Repository
18-
uses: actions/checkout@v4
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Azure Login
17+
uses: azure/login@v1
18+
with:
19+
creds: ${{ secrets.AZURE_CREDENTIALS }}
1920

20-
- name: Setup Node.js
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: '20' # or your Node version
21+
- name: Set up Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 18 # or your Node version
2425

25-
- name: Install Dependencies
26-
run: npm install
26+
- name: Install dependencies
27+
run: |
28+
cd backend
29+
npm install
2730
28-
- name: Deploy to Azure Web App
29-
uses: azure/webapps-deploy@v3
30-
with:
31-
app-name: ${{ secrets.AZURE_WEBAPP_NAME }}
32-
publish-profile: ${{ secrets.AZURE_PUBLISH_PROFILE }}
33-
package: ./backend # <-- Deploy only the backend folder
31+
- name: Deploy to Azure Web App
32+
uses: azure/webapps-deploy@v3
33+
with:
34+
app-name: backendcodecrib
35+
slot-name: production
36+
package: ./backend

0 commit comments

Comments
 (0)