Update main_kasca-server.yml #2
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 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 }} |