Skip to content

Commit d9a5d79

Browse files
committed
closes #9; closes #10
1 parent 0346123 commit d9a5d79

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

.github/workflows/dotnet-cd-prod.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: prod-deploy
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: dependency caching
17+
uses: actions/cache@v4
18+
with:
19+
path: ~/.nuget/packages
20+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
21+
restore-keys: |
22+
${{ runner.os }}-nuget-
23+
24+
- name: dotnet build
25+
run: dotnet build rubberduckvba.Server --configuration Release
26+
27+
- name: dotnet publish
28+
run: dotnet publish "rubberduckvba.Server\rubberduckvba.Server.csproj" --configuration Release --output ${{env.DOTNET_ROOT}}\pub
29+
30+
- name: upload artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: pub
34+
path: ${{env.DOTNET_ROOT}}\pub
35+
36+
deploy:
37+
runs-on: self-hosted
38+
needs: build
39+
steps:
40+
- name: download artifacts
41+
uses: actions/download-artifact@v4
42+
with:
43+
name: pub
44+
45+
- name: deploy iis site
46+
run: |
47+
stop-webapppool -name "api-prod"
48+
stop-iissite -name api-prod -confirm: $false
49+
copy-item C:/pub/* C:/inetpub/wwwroot/rubberduckvba.com -Recurse -Force
50+
copy-item C:/inetpub/appsettings.prod.json C:/inetpub/wwwroot/rubberduckvba.com/appsettings.json -Force
51+
copy-item C:/inetpub/__Web.config C:/inetpub/wwwroot/rubberduckvba.com/wwwroot/browser/Web.config -Force
52+
start-webapppool api-prod
53+
start-iissite api-prod

.github/workflows/dotnet-cd.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ permissions:
1010

1111
jobs:
1212
build:
13-
runs-on: self-hosted
13+
runs-on: ubuntu-latest
1414

1515
steps:
1616
- uses: actions/checkout@v4
1717

18-
- name: Set up dependency caching for faster builds
18+
- name: dependency caching
1919
uses: actions/cache@v4
2020
with:
2121
path: ~/.nuget/packages
@@ -29,14 +29,27 @@ jobs:
2929
- name: dotnet publish
3030
run: dotnet publish "rubberduckvba.Server\rubberduckvba.Server.csproj" --configuration Release --output ${{env.DOTNET_ROOT}}\pub
3131

32+
- name: upload artifacts
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: pub
36+
path: ${{env.DOTNET_ROOT}}\pub
37+
3238
deploy:
3339
runs-on: self-hosted
3440
needs: build
3541
steps:
42+
- name: download artifacts
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: pub
46+
3647
- name: deploy iis site
3748
run: |
3849
stop-webapppool -name "rubberduckvba"
3950
stop-iissite -name api -confirm: $false
40-
copy-item C:/pub/* C:/inetpub/wwwroot -Recurse -Force
51+
copy-item C:/pub/* C:/inetpub/wwwroot/test.rubberduckvba.com -Recurse -Force
52+
copy-item C:/inetpub/appsettings.test.json C:/inetpub/wwwroot/test.rubberduckvba.com/appsettings.json -Force
53+
copy-item C:/inetpub/__Web.config C:/inetpub/wwwroot/test.rubberduckvba.com/wwwroot/browser/Web.config -Force
4154
start-webapppool rubberduckvba
4255
start-iissite api

rubberduckvba.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "rubberduckvba.database", "r
1313
EndProject
1414
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4F5F292F-9F99-47E7-9D88-0DC0D886424F}"
1515
ProjectSection(SolutionItems) = preProject
16+
.github\workflows\dotnet-cd-prod.yml = .github\workflows\dotnet-cd-prod.yml
1617
.github\workflows\dotnet-cd.yml = .github\workflows\dotnet-cd.yml
1718
.github\workflows\dotnet-ci.yml = .github\workflows\dotnet-ci.yml
1819
README.md = README.md

0 commit comments

Comments
 (0)