Skip to content

Commit 646c8b8

Browse files
authored
CXM-5254/actions-workflow-to-deploy-on-release-to-prod (#5)
* workflow to deploy to prod app on release create * Change dev to prod
1 parent d9617c7 commit 646c8b8

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/deploy-prod.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy DotNet project to Azure Function App
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
env:
9+
AZURE_FUNCTIONAPP_NAME: "Prod-STORIS-URL-Redirect"
10+
AZURE_FUNCTIONAPP_PACKAGE_PATH: "."
11+
DOTNET_VERSION: "6.0.x"
12+
13+
jobs:
14+
build-and-deploy:
15+
runs-on: windows-latest
16+
environment: prod
17+
steps:
18+
- name: "Checkout GitHub Action"
19+
uses: actions/checkout@v3
20+
21+
- name: "Login via Azure CLI"
22+
uses: azure/login@v1
23+
with:
24+
creds: ${{ secrets.AZURE_RBAC_CREDENTIALS_PROD }}
25+
26+
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment
27+
uses: actions/setup-dotnet@v3
28+
with:
29+
dotnet-version: ${{ env.DOTNET_VERSION }}
30+
31+
- name: "Resolve Project Dependencies Using Dotnet"
32+
shell: pwsh
33+
run: |
34+
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
35+
dotnet build --configuration Release --output ./output
36+
popd
37+
38+
- name: "Run Azure Functions Action"
39+
uses: Azure/functions-action@v1
40+
id: fa
41+
with:
42+
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
43+
package: "${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output"

0 commit comments

Comments
 (0)