Merge pull request #14 from rubberduck-vba/p0 #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dotnet-CD | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: dependency caching | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: dotnet build | |
run: dotnet build rubberduckvba.Server --configuration Release | |
- name: dotnet publish | |
run: dotnet publish "rubberduckvba.Server\rubberduckvba.Server.csproj" --configuration Release --output ${{env.DOTNET_ROOT}}\pub | |
- name: upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pub | |
path: ${{env.DOTNET_ROOT}}\pub | |
deploy: | |
runs-on: self-hosted | |
needs: build | |
steps: | |
- name: download artifacts | |
uses: actions/[email protected] | |
with: | |
name: pub | |
- name: deploy iis site | |
run: | | |
stop-webapppool -name "rubberduckvba" | |
stop-iissite -name api -confirm: $false | |
copy-item C:/pub/* C:/inetpub/wwwroot/test.rubberduckvba.com -Recurse -Force | |
copy-item C:/inetpub/appsettings.test.json C:/inetpub/wwwroot/test.rubberduckvba.com/appsettings.json -Force | |
copy-item C:/inetpub/__Web.config C:/inetpub/wwwroot/test.rubberduckvba.com/wwwroot/browser/Web.config -Force | |
start-webapppool rubberduckvba | |
start-iissite api |