Skip to content

Commit

Permalink
Update deploy-azure_geotrackr-server.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-63 authored Sep 9, 2024
1 parent 3494547 commit 178b9d4
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/deploy-azure_geotrackr-server.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# 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 Node.js app to Azure Web App - geotrackr-server

on:
Expand All @@ -21,14 +18,15 @@ jobs:
with:
node-version: '20.x'

- name: npm install, build, and test
- name: npm install
run: |
cd server
npm install
npm run build --if-present
npm run test --if-present
- name: Zip artifact for deployment
run: zip release.zip ./* -r
run: |
cd server
zip -r ../release.zip .
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
Expand All @@ -40,10 +38,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 @@ -53,19 +51,18 @@ jobs:

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

- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_05E065B01AB64C3EBE223D289ACDD685 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_CCBB907E50EF466EAB2ABF1911C96D4D }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_4904FD5F5FD248D1B148150E8BEE405A }}

- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'geotrackr-server'
slot-name: 'Production'
slot-name: 'production'
package: .

0 comments on commit 178b9d4

Please sign in to comment.