Skip to content

Revise README for improved clarity and details #57

Revise README for improved clarity and details

Revise README for improved clarity and details #57

name: Build and deploy Node.js app to Azure Web App - thecodepulse
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Node.js version
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: npm install, build, and test
working-directory: ./server
run: |
npm install
npm run build --if-present
npx prisma generate
npm run test --if-present
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: node-app
path: ./server
include-hidden-files: true
deploy:
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write
contents: read
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: node-app
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_B1327807F8FA4D36BEC0B3376E9064D1 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_C842ED5EA7CC4F4DB64AFD1667BE08F4 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_7131FC79F3EB443B92D0CF7F6BB6AD5E }}
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'thecodepulse'
slot-name: 'Production'
package: .