Skip to content

Build and deploy Node.js app to Azure Web App - pumptrack-map-app #70

Build and deploy Node.js app to Azure Web App - pumptrack-map-app

Build and deploy Node.js app to Azure Web App - pumptrack-map-app #70

# 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 - pumptrack-map-app
on:
push:
paths-ignore:
- '**.md'
branches:
- main
workflow_dispatch:
repository_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
NEXT_PUBLIC_CDN_BASE_URL: https://cdn.311312.xyz
NEXT_PUBLIC_CDN_ROOT_DIR: spots
NEXT_PUBLIC_DATA: data
NEXT_PUBLIC_IMAGES: images
NEXT_PUBLIC_PANORAMAS: 360images
NEXT_PUBLIC_VR_VIDEOS: 360videos
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run test --if-present
- name: Zip artifact for deployment
run: zip -r release.zip * .next
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: node-app
path: release.zip
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: node-app
- name: unzip artifact for deployment
run: |
unzip release.zip
rm release.zip
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'pumptrack-map-app'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_48B6A509BE5A41DEB9559B078880DA1A }}
package: .