Fix issue with ENV mismatch between app and service (#109) #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy agent-service to Azure Web App | |
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 | |
test-docker: | |
if: github.repository == 'JoshuaC215/agent-service-toolkit' | |
uses: ./.github/workflows/test-docker.yml | |
build: | |
runs-on: ubuntu-latest | |
needs: [test, test-docker] | |
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 }}' |