Skip to content

Commit 375eb9b

Browse files
committed
CI/CD
1 parent 37485e2 commit 375eb9b

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

.github/workflows/prod.workflow.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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
2.61 KB
Binary file not shown.

0 commit comments

Comments
 (0)