Seraph19 commited on
Commit
c91f6bd
·
verified ·
1 Parent(s): fe1b308

Create env

Browse files
Files changed (1) hide show
  1. env +62 -0
env ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+
6
+ # GitHub recommends pinning actions to a commit SHA.
7
+ # To get a newer version, you will need to update the SHA.
8
+ # You can also reference a tag or branch, but the action may change without warning.
9
+
10
+ on:
11
+ push:
12
+ branches:
13
+ - main
14
+
15
+ env:
16
+ AZURE_WEBAPP_NAME: MY_WEBAPP_NAME # set this to your application's name
17
+ AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
18
+ NODE_VERSION: '14.x' # set this to the node version to use
19
+
20
+ jobs:
21
+ build:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - name: Set up Node.js
27
+ uses: actions/setup-node@v4
28
+ with:
29
+ node-version: ${{ env.NODE_VERSION }}
30
+ cache: 'npm'
31
+
32
+ - name: npm install, build, and test
33
+ run: |
34
+ npm install
35
+ npm run build --if-present
36
+ npm run test --if-present
37
+ - name: Upload artifact for deployment job
38
+ uses: actions/upload-artifact@v4
39
+ with:
40
+ name: node-app
41
+ path: .
42
+
43
+ deploy:
44
+ runs-on: ubuntu-latest
45
+ needs: build
46
+ environment:
47
+ name: 'production'
48
+ url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
49
+
50
+ steps:
51
+ - name: Download artifact from build job
52
+ uses: actions/download-artifact@v4
53
+ with:
54
+ name: node-app
55
+
56
+ - name: 'Deploy to Azure WebApp'
57
+ id: deploy-to-webapp
58
+ uses: azure/webapps-deploy@85270a1854658d167ab239bce43949edb336fa7c
59
+ with:
60
+ app-name: ${{ env.AZURE_WEBAPP_NAME }}
61
+ publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
62
+ package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}