Skip to content

Create azure-webapps-node.yml #5

Create azure-webapps-node.yml

Create azure-webapps-node.yml #5

name: Build and deploy Next.js app to Azure Web App
on:
push:
branches:
- main
workflow_dispatch:
env:
APPLICATION_PUBLISH_PROFILE: ${{ secrets.APP_PUBLISH_PROFILE }}
WEBAPP_NAME: 'medium-next-app-service-deploy'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js version
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: npm install, build, and test
run: |
npm install
npm run build
mv ./build/static ./build/standalone/build
mv ./public ./build/standalone
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: 'next-demo'
slot-name: 'Production'
publish-profile: ${{ secrets.APP_PUBLISH_PROFILE }}
package: ./build/standalone