-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.92 KB
/
azure-functions-app-container.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
# This workflow will build a container and deploy it to an Azure Functions App on Linux when a commit is pushed to your default branch.
name: Deploy container to Azure Functions App
on:
push:
branches: ["master"]
permissions:
contents: read
env:
AZURE_FUNCTIONAPP_NAME: 'iochalki' # set this to your function app name on Azure
LOGIN_SERVER: 'docker.io' # set this to login server for your private container registry (e.g. 'contoso.azurecr.io', 'index.docker.io' )
REGISTRY: 'nikchalkanov' # set this to proper value for REGISTRY
IMAGE: 'iochalki' # set this to proper value for IMAGE
TAG: 'v0.2.1' # set this to proper value for TAG
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: dev
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v3
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: 'Import GPG Key'
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_KEY }}
passphrase: ${{ secrets.GPG_PASS }}
- name: 'DockerHub Login'
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ env.REGISTRY }}/${{ env.AZURE_FUNCTIONAPP_NAME }}:${{ env.TAG }}
- name: 'Run Azure Functions Container Action'
uses: Azure/functions-container-action@v1
id: fa
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
image: ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.TAG }}
- name: 'Published functionapp url'
run: |
echo "${{ steps.fa.outputs.app-url }}"
- name: Azure logout
run: |
az logout