Skip to content

Commit 54be685

Browse files
committed
Refactor Dockerfile to use .NET 8.0 SDK and ASP.NET runtime
1 parent f6a98a9 commit 54be685

File tree

2 files changed

+70
-10
lines changed

2 files changed

+70
-10
lines changed

.github/workflows/dotnet-deploy.yml

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env:
55
repositoryName: techexcel/dotnetcoreapp
66
dockerFolderPath: ./src/Application/src/RazorPagesTestSample
77
tag: ${{github.run_number}}
8-
8+
99
on:
1010
push:
1111
branches: [ main ]
@@ -35,7 +35,6 @@ jobs:
3535
run: dotnet test --no-build --verbosity normal ./src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj
3636

3737
dockerBuildPush:
38-
3938
runs-on: ubuntu-latest
4039
needs: build
4140

@@ -52,7 +51,7 @@ jobs:
5251
# Username used to log against the Docker registry
5352
username: ${{ secrets.ACR_USERNAME }}
5453
# Password or personal access token used to log against the Docker registry
55-
password: ${{ secrets.qkycf2fsjozsgmpnpreg }}
54+
password: ${{ secrets.ACR_PASSWORD }}
5655
# Log out from the Docker registry at the end of a job
5756
logout: true
5857

@@ -61,3 +60,64 @@ jobs:
6160

6261
- name: Docker Push
6362
run: docker push $registryName/$repositoryName:$tag
63+
64+
deploy-to-dev:
65+
66+
runs-on: ubuntu-latest
67+
needs: dockerBuildPush
68+
environment:
69+
name: dev
70+
url: https://qkycf2fsjozsg-dev.azurewebsites.net/
71+
72+
steps:
73+
- name: 'Login via Azure CLI'
74+
uses: azure/[email protected]
75+
with:
76+
creds: ${{ secrets.AZURE_CREDENTIALS }}
77+
78+
- uses: azure/webapps-deploy@v2
79+
with:
80+
app-name: 'qkycf2fsjozsg-dev'
81+
images: {your_registry_name}.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}
82+
83+
deploy-to-test:
84+
85+
runs-on: ubuntu-latest
86+
needs: deploy-to-dev
87+
environment:
88+
name: test
89+
url: https://qkycf2fsjozsg-test.azurewebsites.net/
90+
91+
steps:
92+
- uses: actions/checkout@v3
93+
94+
- name: 'Login via Azure CLI'
95+
uses: azure/[email protected]
96+
with:
97+
creds: ${{ secrets.AZURE_CREDENTIALS }}
98+
99+
- uses: azure/webapps-deploy@v2
100+
with:
101+
app-name: 'qkycf2fsjozsg-test'
102+
images: {your_registry_name}.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}
103+
104+
deploy-to-prod:
105+
106+
runs-on: ubuntu-latest
107+
needs: deploy-to-test
108+
environment:
109+
name: prod
110+
url: https://qkycf2fsjozsg-prod.azurewebsites.net/
111+
112+
steps:
113+
- uses: actions/checkout@v3
114+
115+
- name: 'Login via Azure CLI'
116+
uses: azure/[email protected]
117+
with:
118+
creds: ${{ secrets.AZURE_CREDENTIALS }}
119+
120+
- uses: azure/webapps-deploy@v2
121+
with:
122+
app-name: 'qkycf2fsjozsg-prod'
123+
images: {your_registry_name}.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}

Solution/Exercise-03/Task-3/dotnet-deploy-3.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: .NET CI
22

33
env:
4-
registryName: {your_registry_name}.azurecr.io
4+
registryName: qkycf2fsjozsgmpnpreg.azurecr.io
55
repositoryName: techexcel/dotnetcoreapp
66
dockerFolderPath: ./src/Application/src/RazorPagesTestSample
77
tag: ${{github.run_number}}
@@ -67,7 +67,7 @@ jobs:
6767
needs: dockerBuildPush
6868
environment:
6969
name: dev
70-
url: https://{your_prefix}-dev.azurewebsites.net/
70+
url: https://qkycf2fsjozsg-dev.azurewebsites.net/
7171

7272
steps:
7373
- name: 'Login via Azure CLI'
@@ -77,7 +77,7 @@ jobs:
7777

7878
- uses: azure/webapps-deploy@v2
7979
with:
80-
app-name: '{your_prefix}-dev'
80+
app-name: 'qkycf2fsjozsg-dev'
8181
images: {your_registry_name}.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}
8282

8383
deploy-to-test:
@@ -86,7 +86,7 @@ jobs:
8686
needs: deploy-to-dev
8787
environment:
8888
name: test
89-
url: https://{your_prefix}-test.azurewebsites.net/
89+
url: https://qkycf2fsjozsg-test.azurewebsites.net/
9090

9191
steps:
9292
- uses: actions/checkout@v3
@@ -98,7 +98,7 @@ jobs:
9898

9999
- uses: azure/webapps-deploy@v2
100100
with:
101-
app-name: '{your_prefix}-test'
101+
app-name: 'qkycf2fsjozsg-test'
102102
images: {your_registry_name}.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}
103103

104104
deploy-to-prod:
@@ -107,7 +107,7 @@ jobs:
107107
needs: deploy-to-test
108108
environment:
109109
name: prod
110-
url: https://{your_prefix}-prod.azurewebsites.net/
110+
url: https://qkycf2fsjozsg-prod.azurewebsites.net/
111111

112112
steps:
113113
- uses: actions/checkout@v3
@@ -119,5 +119,5 @@ jobs:
119119

120120
- uses: azure/webapps-deploy@v2
121121
with:
122-
app-name: '{your_prefix}-prod'
122+
app-name: 'qkycf2fsjozsg-prod'
123123
images: {your_registry_name}.azurecr.io/techexcel/dotnetcoreapp:${{github.run_number}}

0 commit comments

Comments
 (0)