Skip to content

Commit

Permalink
added node sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
Saipriya-1144 committed Oct 6, 2024
1 parent 1593b78 commit 0d666eb
Show file tree
Hide file tree
Showing 4 changed files with 3,183 additions and 18 deletions.
68 changes: 50 additions & 18 deletions .github/workflows/github_actions_test.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy ASP.Net Core app to Azure Web App - dotnetapp-githubactions-test
name: Build and deploy to Azure App Services

on:
push:
branches:
- master
- updated_contents
schedule:
- cron: "0 0/3 * * *"

jobs:
build:
build-and-deploy-dotnet-app:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -42,21 +42,6 @@ jobs:
name: .net-app
path: myapp

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: .net-app

- name: Login to Azure
uses: azure/login@v2
with:
Expand All @@ -70,4 +55,51 @@ jobs:
with:
app-name: 'lwasv2-euap-dotnet-githubactionstest'
slot-name: 'Production'
package: .

build-and-deploy-node-app:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: npm install, build, and test
run: |
cd __tests__/nodesampleapp
npm install
npm run build --if-present
npm run test --if-present
- name: Zip artifact for deployment
run: |
cd __tests__/nodesampleapp
zip release.zip ./* -r
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: node-app
path: release.zip

- name: Unzip artifact for deployment
run: unzip release.zip

- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_D673514B6B844964A5F6FFC61D392F0B }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_B2C988C781F444929603CC1514D9D043 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_3D739CA9833E4DC881A48CA31F2DFE2D }}

- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'lwasv2-euap-node-18-githubactions'
slot-name: 'Production'
package: .
Loading

0 comments on commit 0d666eb

Please sign in to comment.