Skip to content

Build and release Node test function #3

Build and release Node test function

Build and release Node test function #3

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Build and release Node test function
on:
push:
branches: [ "master" ]
paths:
- /src/Azure/Nodejs/**
workflow_dispatch:
jobs:
buildTest:
name: Build Test Function
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install zip
uses: montudor/action-zip@v1
- name: Zip outputs
working-directory: ${{ github.workspace }}/src/Azure/Nodejs
run: zip -qq -r ${{ github.workspace }}/test.zip .
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.1
with:
name: test
path: ./test.zip
deploy:
name: Deploy application
runs-on: ubuntu-latest
needs: ["buildTest"]
steps:
# Checkout code
- uses: actions/checkout@v3
# Log into Azure
- name: login to azure cli
run: az login --service-principal -u ${{ secrets.AZURE_APPID }} -p ${{ secrets.AZURE_APPSECRET }} --tenant ${{ secrets.AZURE_TENANT }}
- name: deploy bicep
run: az stack group create --subscription "${{ secrets.AZURE_SUBSCRIPTION }}" --resource-group "${{ secrets.AZURE_RG }}" --template-file ./src/Azure/Nodejs/deployment.bicep --parameters prefix=${{ secrets.DEPLOYMENT_PREFIX }} --name node --deny-settings-mode None --delete-resources true --deny-settings-excluded-principals ${{ secrets.AZURE_OBJECTID }}
- name: Download Test Artifact
uses: actions/download-artifact@v3.0.1
with:
name: test
path: ./outputs/test
- name: Deploy linux test
run: az functionapp deployment source config-zip --subscription "${{ secrets.AZURE_SUBSCRIPTION }}" --resource-group "${{ secrets.AZURE_RG }}" --src "./outputs/test/test.zip" --name "${{ secrets.DEPLOYMENT_PREFIX }}nodelin"
- name: Deploy windows test
run: az functionapp deployment source config-zip --subscription "${{ secrets.AZURE_SUBSCRIPTION }}" --resource-group "${{ secrets.AZURE_RG }}" --src "./outputs/test/test.zip" --name "${{ secrets.DEPLOYMENT_PREFIX }}nodewin"