Skip to content

Commit d817473

Browse files
committed
feat: enhancements to cicd
1 parent 19e9fa6 commit d817473

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

.github/workflows/main_msal-react-kotahusky.yml

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
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
52

63
on:
74
push:
8-
tags:
9-
- '*'
5+
branches:
6+
- main
107
workflow_dispatch:
118

9+
env:
10+
APP_NAME: 'msal-react'
11+
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
@@ -24,11 +24,16 @@ jobs:
2424
- name: npm install, build, and test
2525
run: |
2626
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 }}
2934

3035
- name: Zip artifact for deployment
31-
run: zip release.zip ./* -r
36+
run: zip release.zip dist/apps/${{ env.APP_NAME }} -r
3237

3338
- name: Upload artifact for deployment job
3439
uses: actions/upload-artifact@v3
@@ -56,7 +61,7 @@ jobs:
5661
id: deploy-to-webapp
5762
uses: azure/webapps-deploy@v2
5863
with:
59-
app-name: 'msal-react-kotahusky'
64+
app-name: ${{ env.APP_NAME }}
6065
slot-name: 'Production'
6166
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_8AD7EEE609AA4B08996ADF2983056C0F }}
62-
package: .
67+
package: dist/apps/${{ env.APP_NAME }}

0 commit comments

Comments
 (0)