Starter workflows for Azure Functions App

This commit is contained in:
Chandni Patel
2022-11-04 16:40:05 -05:00
committed by Chandni Patel
parent 51e3d515e9
commit aa953da46e
12 changed files with 342 additions and 0 deletions
@@ -0,0 +1,57 @@
# Action Requires
# 1. Setup the AZURE_CREDENTIALS secrets in your GitHub Repository
# 2. Setup the REGISTRY_USERNAME secrets in your GitHub Repository
# 3. Setup the REGISTRY_PASSWORD secrets in your GitHub Repository
# 4. Replace REGISTRY, NAMESPACE, IMAGE, TAG in the following template with proper values
# 5. Add this yaml file to your project's .github/workflows/
# 6. Push your local project to your GitHub Repository
name: Linux_Container_Workflow
on:
push:
branches:
- master
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: 'Docker Login'
uses: azure/docker-login@v1
with:
login-server: contoso.azurecr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: 'Compose Customized Docker Image'
shell: bash
run: |
# If your function app project is not located in your repository's root
# Please change the path to your directory for docker build
docker build . -t REGISTRY/NAMESPACE/IMAGE:TAG
docker push REGISTRY/NAMESPACE/IMAGE:TAG
- name: 'Run Azure Functions Container Action'
uses: Azure/functions-container-action@v1
id: fa
with:
app-name: PLEASE_REPLACE_THIS_WITH_YOUR_FUNCTION_APP_NAME
image: REGISTRY/NAMESPACE/IMAGE:TAG
#- name: 'use the published functionapp url in upcoming steps'
# run: |
# echo "${{ steps.fa.outputs.app-url }}"
- name: Azure logout
run: |
az logout