File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and deploy to production
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ build-and-deploy :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+
14
+ - name : Checkout GitHub Actions
15
+ uses : actions/checkout@main
16
+
17
+
18
+ - name : Login via Azure CLI
19
+ uses : azure/login@v1
20
+ with :
21
+ creds : ${{ secrets.AZURE_CREDENTIALS }}
22
+
23
+
24
+ - name : Login to Azure Container Registry
25
+ uses : azure/docker-login@v1
26
+ with :
27
+ login-server : ragazurefastapi.azurecr.io
28
+ username : ${{ secrets.REGISTRY_USERNAME }}
29
+ password : ${{ secrets.REGISTRY_PASSWORD }}
30
+
31
+
32
+ - name : Build and push container image to registry
33
+ run : |
34
+ docker build . -t ragazurefastapi.azurecr.io/ragazurefastapi:${{ github.sha }}
35
+ docker push ragazurefastapi.azurecr.io/ragazurefastapi:${{ github.sha }}
36
+
37
+
38
+ - name : Deploy to App Service
39
+ uses : azure/webapps-deploy@v2
40
+ with :
41
+ app-name : ' winereco'
42
+ images : ' ragazurefastapi.azurecr.io/ragazurefastapi:${{ github.sha }}'
43
+ slot-name : ' staging'
44
+
45
+
46
+ - name : Azure logout
47
+ run : |
48
+ az logout
You can’t perform that action at this time.
0 commit comments