Skip to content

Merge pull request #6 from PilotChalkanov/feature/cicd #7

Merge pull request #6 from PilotChalkanov/feature/cicd

Merge pull request #6 from PilotChalkanov/feature/cicd #7

# 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.1.0' # set this to proper value for TAG
jobs:
build-and-deploy:

Check failure on line 20 in .github/workflows/azure-functions-app-container.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/azure-functions-app-container.yml

Invalid workflow file

You have an error in your yaml syntax on line 20
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: ${{ env.LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: 'Import GPG Key'
uses: crazy-max/ghaction-import-gpg@v1
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASS }}
- name: 'Compose Customized Docker Image'
shell: bash
run: |
docker build . -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ env.TAG }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ 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