-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·72 lines (59 loc) · 1.97 KB
/
Copy pathdevelop_oraifunctions.yml
File metadata and controls
executable file
·72 lines (59 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# This workflow builds and deploys the Functions app when pushing to the 'develop' branch.
name: Build and deploy Node.js project to Azure Function App - OrAIFunctions (develop)
on:
push:
branches:
- develop
workflow_dispatch:
env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: 'backend-azure-functions-js'
NODE_VERSION: '20.x'
jobs:
build:
runs-on: windows-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install and Build
shell: pwsh
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
npm install
npm run build --if-present
npm run test --if-present
popd
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: node-app
path: .
deploy:
runs-on: windows-latest
needs: build
permissions:
id-token: write
contents: read
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: node-app
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_A46F75F59F414A4CAB23AD5D4B80193A }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_7ADD13028C6C40AD9927366A04EC54A4 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_31A91948BF0A4FC5825B60AC6CAEDD1E }}
- name: Deploy to Azure Functions (staging slot)
uses: Azure/functions-action@v1
with:
app-name: 'OrAIFunctions-cons'
slot-name: 'staging'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}