Merge branch 'main' of https://github.com/vtfk/azf-vigo-isi #261
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
# This workflow will build and push a node.js application to an Azure Function App when a release is created. | |
# | |
# This workflow assumes you have already created the target Azure Function App. | |
# For instructions see https://docs.microsoft.com/azure/app-service/app-service-plan-manage#create-an-app-service-plan | |
# | |
# To configure this workflow: | |
# | |
# 1. For Linux apps, add an app setting called WEBSITE_WEBDEPLOY_USE_SCM and set it to true in your app **before downloading the file**. | |
# For more instructions see: https://docs.microsoft.com/azure/app-service/configure-common#configure-app-settings | |
# | |
# 2. Set up a secret in your repository named AZURE_FUNCTIONAPP_PUBLISH_PROFILE with the value of your Azure publish profile. | |
# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret | |
# | |
# 3. Change the values for the AZURE_FUNCTIONAPP_NAME, AZURE_FUNCTIONAPP_PACKAGE_PATH and NODE_VERSION environment variables (below). | |
# | |
# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions | |
# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples | |
name: Deploy to Azure Functions - TEST | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
env: | |
AZURE_FUNCTIONAPP_NAME: test-func-vigo-isi # set this to your application's name | |
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root | |
NODE_VERSION: '14.x' # set this to the node version to use (supports 8.x, 10.x, 12.x) | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@master | |
- name: Setup Node ${{ env.NODE_VERSION }} Environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: npm install, build, and test | |
shell: pwsh | |
run: | | |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' | |
npm install | |
npm run build --if-present | |
npm run test | |
popd | |
- name: 'Deploy Azure Function' | |
uses: Azure/functions-action@v1 | |
id: fa | |
with: | |
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} | |
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} | |
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE_TEST }} |