Skip to content

Commit e251ba9

Browse files
authored
Create deploy.yml
1 parent 9173ebb commit e251ba9

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy Azure Function
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
workflow_dispatch:
7+
8+
env:
9+
# Replace the value below with the name of your pre-created function app
10+
# (find it in the Azure Portal, e.g. carvedrock-func-xxxxxxxx).
11+
AZURE_FUNCTIONAPP_NAME: REPLACE_WITH_YOUR_FUNCTION_APP_NAME
12+
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.'
13+
NODE_VERSION: '20.x'
14+
15+
jobs:
16+
build-and-deploy:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check out repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Node ${{ env.NODE_VERSION }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ env.NODE_VERSION }}
26+
27+
- name: Install dependencies (build and package)
28+
shell: bash
29+
run: |
30+
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
31+
npm install --if-present
32+
popd
33+
34+
- name: Deploy to Azure Functions
35+
uses: Azure/functions-action@v1
36+
with:
37+
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
38+
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
39+
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}

0 commit comments

Comments
 (0)