Create azure-webapps-node.yml #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |