-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (49 loc) · 1.34 KB
/
microless.yml
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
name: Microless deployment
on:
push:
branches:
- microless
env:
AZURE_FUNCTIONAPP_NAME: func-microless-eastus2
AZURE_FUNCTIONAPP_PACKAGE_PATH: "./code/serverless/microless"
NODE_VERSION: "14.x"
jobs:
test-code:
name: Test code
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- name: Checkout from GitHub
uses: actions/checkout@master
- name: Run the tests
run: |
cd ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
npm install
npm run test --if-present
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
needs: test-code
steps:
- name: Checkout from GitHub
uses: actions/checkout@master
- name: Setup Node Environment
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- name: Installing Dependecies
shell: bash
run: |
cd ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
pushd .
npm install
npm run build
popd
- name: Deploy to Azure
uses: Azure/[email protected]
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.MICROLESS_FUNCTION_PROFILE }}