1
- # Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2
- # More GitHub Actions for Azure: https://github.com/Azure/actions
3
-
4
- name : Build and deploy Node.js app to Azure Web App - msal-react-kotahusky
1
+ name : Build and deploy Nx Next.js app to Azure Web App - msal-react-kotahusky
5
2
6
3
on :
7
4
push :
8
- tags :
9
- - ' * '
5
+ branches :
6
+ - main
10
7
workflow_dispatch :
11
8
9
+ env :
10
+ APP_NAME : ' msal-react'
11
+
12
12
jobs :
13
13
build :
14
14
runs-on : ubuntu-latest
@@ -24,11 +24,16 @@ jobs:
24
24
- name : npm install, build, and test
25
25
run : |
26
26
npm install
27
- npm run build --if-present
28
- npm run test --if-present
27
+ npx nx build ${{ env.APP_NAME }} --prod
28
+ npx nx test ${{ env.APP_NAME }}
29
+ env :
30
+ NEXT_PUBLIC_CLIENT_ID : ${{ secrets.NEXT_PUBLIC_CLIENT_ID }}
31
+ NEXT_PUBLIC_TENANT_ID : ${{ secrets.NEXT_PUBLIC_TENANT_ID }}
32
+ NEXT_PUBLIC_REDIRECT_URI : ${{ secrets.NEXT_PUBLIC_REDIRECT_URI }}
33
+ APP_NAME : ${{ env.APP_NAME }}
29
34
30
35
- name : Zip artifact for deployment
31
- run : zip release.zip ./* -r
36
+ run : zip release.zip dist/apps/${{ env.APP_NAME }} -r
32
37
33
38
- name : Upload artifact for deployment job
34
39
uses : actions/upload-artifact@v3
56
61
id : deploy-to-webapp
57
62
uses : azure/webapps-deploy@v2
58
63
with :
59
- app-name : ' msal-react-kotahusky '
64
+ app-name : ${{ env.APP_NAME }}
60
65
slot-name : ' Production'
61
66
publish-profile : ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_8AD7EEE609AA4B08996ADF2983056C0F }}
62
- package : .
67
+ package : dist/apps/${{ env.APP_NAME }}
0 commit comments