Skip to content

Commit 8a3ae2e

Browse files
committed
Add or update the Azure App Service build and deployment workflow config
1 parent 26c726a commit 8a3ae2e

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2+
# More GitHub Actions for Azure: https://github.com/Azure/actions
3+
4+
name: Build and deploy container app to Azure Web App - andre-emotion-app
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read #This is required for actions/checkout
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v2
23+
24+
- name: Log in to container registry
25+
uses: docker/login-action@v2
26+
with:
27+
registry: index.docker.io/
28+
username: ${{ secrets.AZUREAPPSERVICE_CONTAINERUSERNAME_49D01B149BDC4DCBB6ED930F1C9F802E }}
29+
password: ${{ secrets.AZUREAPPSERVICE_CONTAINERPASSWORD_75074109E9A44167BE49ADDE0225D2AB }}
30+
31+
- name: Build and push container image to registry
32+
uses: docker/build-push-action@v3
33+
with:
34+
context: .
35+
push: true
36+
tags: index.docker.io/${{ secrets.AZUREAPPSERVICE_CONTAINERUSERNAME_49D01B149BDC4DCBB6ED930F1C9F802E }}/andrepaez23/emotion-app:${{ github.sha }}
37+
file: ./Dockerfile
38+
39+
deploy:
40+
runs-on: ubuntu-latest
41+
permissions:
42+
id-token: write #This is required for requesting the JWT
43+
contents: read #This is required for actions/checkout
44+
45+
needs: build
46+
47+
steps:
48+
49+
- name: Login to Azure
50+
uses: azure/login@v2
51+
with:
52+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_25469A3745B74EAB94624728F453D0D8 }}
53+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_AE414F120A654D8D85196D7C82EC9BC1 }}
54+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_59CD58282EB74B4B9257BA6433A2356B }}
55+
56+
- name: Deploy to Azure Web App
57+
id: deploy-to-webapp
58+
uses: azure/webapps-deploy@v2
59+
with:
60+
app-name: 'andre-emotion-app'
61+
slot-name: 'Production'
62+
images: 'index.docker.io/${{ secrets.AZUREAPPSERVICE_CONTAINERUSERNAME_49D01B149BDC4DCBB6ED930F1C9F802E }}/andrepaez23/emotion-app:${{ github.sha }}'
63+

0 commit comments

Comments
 (0)