Skip to content

Commit e7439a4

Browse files
authored
Merge pull request #16 from docusign/main
Add Ci/CD
2 parents b2e435c + 7aaa594 commit e7439a4

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/ci-cd.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and Deploy to Azure Web App
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
env:
10+
AZURE_WEBAPP_NAME: "dssa-business"
11+
IMAGE_NAME: "business"
12+
TAG: "latest"
13+
14+
permissions:
15+
id-token: write
16+
contents: read
17+
18+
jobs:
19+
build_and_deploy:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
# Log in to Azure via OIDC
27+
- name: Azure Login
28+
uses: azure/login@v2
29+
with:
30+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
31+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
32+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
33+
34+
- name: Login to ACR
35+
run: az acr login --name ${{ secrets.ACR_LOGIN_SERVER }}
36+
37+
- name: Build and Push Docker Image
38+
uses: docker/build-push-action@v6
39+
with:
40+
context: .
41+
file: DocuSign.MyBusiness/DocuSign.MyBusiness/Dockerfile
42+
push: true
43+
tags: ${{ secrets.ACR_LOGIN_SERVER }}/${{ env.IMAGE_NAME }}:${{ env.TAG }}
44+
45+
- name: Restart Azure Web App
46+
run: |
47+
az webapp restart --name ${{ env.AZURE_WEBAPP_NAME }} --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }}

0 commit comments

Comments
 (0)