54 lines (49 loc) · 1.54 KB
/
deploy-function.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
name: 🚀 Deploy WebHook Fn
on:
workflow_dispatch:
push:
branches: [ main ]
env:
rg: cdfunc
ghes: https://colindembovsky-0cd7b2095901bb090.gh-quality.net
org: central
repo: ephemeral-runner
ignore_label: permanent
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
defaults:
run:
working-directory: MonaResponder
steps:
- uses: actions/checkout@v2
- name: az login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Create function app
run: ../infra/deploy.sh
env:
rg: ${{ env.rg }}
server: ${{ env.ghes }}
pat: ${{ secrets.REPO_PAT }}
org: ${{ env.org }}
repo: ${{ env.repo }}
secret: ${{ secrets.SECRET }}
ignore_label: ${{ env.ignore_label }}
- name: Install func tools
run: npm install -g azure-functions-core-tools
- name: Install packages
run: npm install
- name: Build
run: npm run build:production
- name: Pack function
run: func pack --typescript
- name: Deploy function
run: az functionapp deploy -n ${{ env.rg }}fn -g ${{ env.rg }} --src-path MonaResponder.zip --type zip --clean true --restart true
- name: Display URL
run: |
url=$(az functionapp show -g ${{ env.rg }} -n ${{ env.rg }}fn --query "hostNames[0]" -o tsv)
key=$(az functionapp keys list -g ${{ env.rg }} -n ${{ env.rg }}fn --query "functionKeys.default" -o tsv)
echo "URL for WebHook is https://$url/api/WorkflowJob?code=$key"