Skip to content

Merge pull request #3 from rubberduck-vba/cd #23

Merge pull request #3 from rubberduck-vba/cd

Merge pull request #3 from rubberduck-vba/cd #23

Workflow file for this run

name: dotnet-CD
on:
push:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Set up dependency caching for faster builds
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build with dotnet
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
deploy:
runs-on: self-hosted
needs: build
steps:
- name: Deploy to IIS
run: |
stop-webapppool -name "rubberduckvba"
stop-iissite -name api -confirm: $false
copy-item C:/pub/* C:/inetpub/wwwroot -Recurse -Force
start-webapppool rubberduckvba
start-iissite api