Skip to content

Update main_kasca-server.yml #2

Update main_kasca-server.yml

Update main_kasca-server.yml #2

name: Build and deploy Node.js project to Azure Function App - kasca-server
on:
push:
branches:
- main
workflow_dispatch:
env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: 'server' # Set to your project directory
NODE_VERSION: '22.x' # Set the Node.js version
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- name: Setup Node ${{ env.NODE_VERSION }} Environment
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Install Dependencies and Build Project with PNPM'
shell: bash
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
pnpm install --frozen-lockfile
pnpm run build
popd
- name: 'Deploy to Azure Functions'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'kasca-server'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_50C06133FAA045658DF029920A77CCD8 }}