-
Notifications
You must be signed in to change notification settings - Fork 121
52 lines (43 loc) · 1.44 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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
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 }}'