-
Notifications
You must be signed in to change notification settings - Fork 64
63 lines (53 loc) · 2.18 KB
/
Copy pathBuildDeploy.yml
File metadata and controls
63 lines (53 loc) · 2.18 KB
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
53
54
55
56
57
58
59
60
61
62
63
name: Build Container Image and Deploy to Azure App Service
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Azure Login
uses: Azure/login@v2.2.0
with:
# Paste output of `az ad sp create-for-rbac` as value of secret variable: AZURE_CREDENTIALS
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: ACR build
id: acr
uses: azure/acr-build@v1
with:
service_principal: ${{ secrets.AZURE_SP_CLIENT_ID }}
service_principal_password: ${{ secrets.AZURE_SP_CLIENT_SECRET }}
tenant: ${{ secrets.AZURE_TENANT_ID }}
registry: icecreamchatsolutionlblickacrlh7n4czwniybc.azurecr.io
repository: dev-summit/ice-cream-bot
tag: ${{ github.sha }}
git_access_token: ${{ secrets.GITHUB_TOKEN }}
folder: bot/
dockerfile: ./Dockerfile
branch: main
- name: Azure Container Registry Login
uses: Azure/docker-login@v1
with:
# Container registry username
username: ${{ secrets.AZURE_SP_CLIENT_ID }}
# Container registry password
password: ${{ secrets.AZURE_SP_CLIENT_SECRET }}
# Container registry server url
login-server: icecreamchatsolutionlblickacrlh7n4czwniybc.azurecr.io
- name: Azure WebApp
uses: Azure/webapps-deploy@v3.0.1
with:
# Name of the Azure Web App
app-name: icecreamchat-solution-lblick-webapp-lh7n4czwniybc
# Applies to Web App Containers only: Specify the fully qualified container image(s) name. For example, 'myregistry.azurecr.io/nginx:latest' or 'python:3.7.2-alpine/'. For multi-container scenario multiple container image names can be provided (multi-line separated)
images: icecreamchatsolutionlblickacrlh7n4czwniybc.azurecr.io/dev-summit/ice-cream-bot:${{ github.sha }}
# Enter the resource group name of the web app
resource-group-name: rg-icecreamchat-solution-lblick-lh7n4czwniybc
# Restart the app service after deployment
restart: true
- name: Azure logout
run: |
az logout