forked from anthonychu/functions-headless-chromium
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (68 loc) · 2.69 KB
/
azure.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy Node.js project to Azure Function App - sturesponse-au
env:
AZURE_FUNCTIONAPP_PACKAGE_PATH: './puppeteer/' # 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)
on:
push:
branches:
- main
# workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v2
# Note: cannot use RBAC since it forces WEBSITE_RUN_FROM_PACKAGE - need to use publish profile
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE964 }}
- name: 'Set CORS on sites to include local test site '
shell: bash
run: |
az webapp cors add -g sturesponseau -n sturesponse-au --allowed-origins https://fn.stuarteggerton.com
az webapp cors add -g sturesponseau -n sturesponse-eu --allowed-origins https://fn.stuarteggerton.com
az webapp cors add -g sturesponseau -n sturesponse-us --allowed-origins https://fn.stuarteggerton.com
- name: Setup Node ${{ env.NODE_VERSION }} Environment
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Resolve Project Dependencies Using Npm'
shell: bash
run: |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
npm install
popd
- name: 'Run Azure Functions Action AU'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'sturesponse-au'
slot-name: 'production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZURE_FN_PUBLISH_PROFILE_AU }}
scm-do-build-during-deployment: true
enable-oryx-build: true
- name: 'Run Azure Functions Action US'
uses: Azure/functions-action@v1
id: fa2
with:
app-name: 'sturesponse-us'
slot-name: 'production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZURE_FN_PUBLISH_PROFILE_US }}
scm-do-build-during-deployment: true
enable-oryx-build: true
- name: 'Run Azure Functions Action EU'
uses: Azure/functions-action@v1
id: fa3
with:
app-name: 'sturesponse-eu'
slot-name: 'production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZURE_FN_PUBLISH_PROFILE_EU }}
scm-do-build-during-deployment: true
enable-oryx-build: true