Skip to content

Commit

Permalink
Add or update the Azure App Service build and deployment workflow config
Browse files Browse the repository at this point in the history
  • Loading branch information
yashcrest committed Jun 19, 2024
1 parent 146b84c commit 3c7c8cd
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions .github/workflows/main_mern-chatapp-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,16 @@ jobs:
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: "20.x"

- name: Navigate to backend folder
run: cd backend
node-version: '20.x'

- name: npm install, build, and test
run: |
cd backend
npm install
npm run build --if-present
npm run test --if-present
- name: Zip artifact for deployment
run: |
cd backend
zip -r ../release.zip .
run: zip release.zip ./* -r

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
Expand All @@ -46,10 +40,10 @@ jobs:
runs-on: ubuntu-latest
needs: build
environment:
name: "Production"
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write #This is required for requesting the JWT
permissions:
id-token: write #This is required for requesting the JWT

steps:
- name: Download artifact from build job
Expand All @@ -59,18 +53,19 @@ jobs:

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

- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_48CC34D635294C5C8106F43C2AC079B0 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_5B578D2DAFA84375B653850D8E474F76 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_454E74427BA54DA39BC296484F3712F3 }}

- name: Login to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_927C8B1DA7C14569A60D609C97C9FDB3 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_BFF2B48712994CBB96D398D057203973 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_6D5AC9CF5E7C4B0693EC84A1B9ACCEDB }}

- name: "Deploy to Azure Web App"
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: "mern-chatapp-api"
slot-name: "Production"
package: ./release
app-name: 'mern-chatapp-api'
slot-name: 'Production'
package: .

0 comments on commit 3c7c8cd

Please sign in to comment.