Skip to content

Merge pull request #123 from kryvokhyzha/dev #72

Merge pull request #123 from kryvokhyzha/dev

Merge pull request #123 from kryvokhyzha/dev #72

Workflow file for this run

name: Deploy to Azure
on:
push:
branches:
- main
workflow_dispatch:
inputs:
deploy_enabled:
description: 'Enable deployment (set to "true" to deploy)'
required: true
default: "false"
type: choice
options:
- "false"
- "true"
jobs:
test:
# Don't try to run deployment in forks and repo copies
if: github.repository == 'kryvokhyzha/langgraph-agent-toolkit'
uses: ./.github/workflows/test.yml
build:
runs-on: ubuntu-latest
needs: [test]
# Skip build if not manually triggered with deploy_enabled=true
if:
github.event_name == 'workflow_dispatch' &&
github.event.inputs.deploy_enabled == 'true'
steps:
- uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to container registry
uses: docker/login-action@v3
with:
registry: https://index.docker.io/v1/
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push agent-service container image to registry
uses: docker/build-push-action@v6
with:
context: .
push: true
tags:
index.docker.io/${{ secrets.DOCKER_USERNAME
}}/agent-service-toolkit.service:${{ github.sha }}
file: docker/api/Dockerfile
deploy:
runs-on: ubuntu-latest
needs: build
# This job will only run if build job runs and succeeds
if: always() && needs.build.result == 'success'
steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: "agent-service"
slot-name: "production"
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
images:
"index.docker.io/${{ secrets.DOCKER_USERNAME
}}/agent-service-toolkit.service:${{ github.sha }}"