File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI/CD Pipeline ELysium
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+ branches :
9+ - develop
10+ - main
11+
12+ env :
13+ AZURE_WEBAPP_NAME : elysiumFrontEnd
14+ AZURE_WEBAPP_PACKAGE_PATH : ' .'
15+ NODE_VERSION : ' 22.x'
16+
17+ jobs :
18+ build-and-deploy :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - name : Checkout repository
22+ uses : actions/checkout@v4
23+
24+ - uses : azure/login@v1
25+ with :
26+ creds : ${{ secrets.AZURE_CREDENTIALS }}
27+
28+ - name : Cache Node.js modules
29+ uses : actions/cache@v3
30+ with :
31+ path : ~/.npm
32+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
33+ restore-keys : |
34+ ${{ runner.os }}-node-
35+
36+ - name : Setup Node.js
37+ uses : actions/setup-node@v4
38+ with :
39+ node-version : ${{ env.NODE_VERSION }}
40+ cache : ' npm'
41+
42+ - name : Install dependencies
43+ run : npm install
44+
45+ - name : Run tests
46+ run : npm run test --if-present
47+
48+ - name : Build project
49+ run : npm run build --if-present
50+
51+ - name : Deploy to Azure Web Apps
52+ uses : azure/webapps-deploy@v3
53+ with :
54+ app-name : ${{ env.AZURE_WEBAPP_NAME }}
55+ package : ./build
56+
57+ - name : Logout from Azure
58+ run : az logout
You can’t perform that action at this time.
0 commit comments