Skip to content

Commit 5d8e053

Browse files
authored
Merge pull request #10 from docusign/cicd
feat(cicd): Init
2 parents 78b3bf1 + b09a4b4 commit 5d8e053

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)