Skip to content

Commit 9ea254c

Browse files
Merge pull request #20 from platzi/amines/19
Update containerDeployment.yml
2 parents 87f85c2 + 542e5c7 commit 9ea254c

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/containerDeployment.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ on:
55
branches: [ "main" ]
66

77
env:
8-
IMAGE_BASE_NAME: aminespinoza/apicontactos
8+
IMAGE_BASE_NAME: aminespinoza/apicontactos:latest
9+
RESOURCE_GROUP: rg--warm-wren
10+
ENVIRONMENT_NAME: devops-env
911

1012
jobs:
1113
API_Image:
@@ -17,6 +19,15 @@ jobs:
1719
- name: Check out the repo
1820
uses: actions/checkout@v3
1921

22+
- name: Azure Login
23+
uses: Azure/[email protected]
24+
with:
25+
creds: ${{ secrets.AZURE_CREDENTIALS }}
26+
27+
- name: Install az containerapp extension
28+
run: |
29+
az config set extension.use_dynamic_install=yes_without_prompt
30+
2031
- name: Build Docker NET image
2132
run: |
2233
docker build --platform linux -t $IMAGE_BASE_NAME .
@@ -29,4 +40,8 @@ jobs:
2940

3041
- name: Deploy image to hub
3142
run: |
32-
docker push $IMAGE_BASE_NAME:latest
43+
docker push $IMAGE_BASE_NAME
44+
45+
- name: Deploy Container App
46+
run: |
47+
az containerapp up --name contactosapi --image $IMAGE_BASE_NAME --resource-group $RESOURCE_GROUP --environment $ENVIRONMENT_NAME --ingress external --target-port 8080

0 commit comments

Comments
 (0)