Skip to content

Merge pull request #129 from JoshuaC215/fix-run-agent #66

Merge pull request #129 from JoshuaC215/fix-run-agent

Merge pull request #129 from JoshuaC215/fix-run-agent #66

Workflow file for this run

name: Deploy to Azure
on:
push:
branches:
- main
workflow_dispatch:
jobs:
test:
# Don't try to run deployment in forks and repo copies
if: github.repository == 'JoshuaC215/agent-service-toolkit'
uses: ./.github/workflows/test.yml
build:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to container registry
uses: docker/login-action@v2
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@v3
with:
context: .
push: true
tags: index.docker.io/${{ secrets.DOCKER_USERNAME }}/agent-service-toolkit.service:${{ github.sha }}
file: docker/Dockerfile.service
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
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 }}'