How to use this appendix
Use this as the complete GitHub Actions workflow reference for the demo applications.
Use these listings on GitHub.com with current hosted Windows runners. The actions use Node 24; self-hosted runners must meet the actions’ documented runner requirements. See setup-dotnet and upload-artifact. The S3 workflow still requires an approved AWS authentication step, AWS CLI v2 and the S3_BUCKET value; its placeholder comments are not a working authentication configuration. See Prerequisites.
E.1 C# workflow
Path:
.github/workflows/csharp-ci.yml
name: C# CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.0.x'
- name: Restore
run: dotnet restore JenkinsCSharpDemo.sln
- name: Build
run: dotnet build JenkinsCSharpDemo.sln --configuration Release --no-restore
- name: Test
run: dotnet test JenkinsCSharpDemo.sln --configuration Release --no-build
- name: Publish
shell: pwsh
run: |
dotnet publish src/JenkinsHelloWorld/JenkinsHelloWorld.csproj `
--configuration Release `
--runtime win-x64 `
--self-contained false `
--output artifacts/publish
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: JenkinsHelloWorld
path: artifacts/publish
if-no-files-found: error
If the demo targets a different supported .NET version, change
dotnet-version.
E.2 Static-site workflow
Path:
.github/workflows/static-site.yml
name: Static Site CD
on:
push:
branches:
- main
jobs:
validate-and-deploy:
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Validate static site
shell: pwsh
run: ./scripts/Test-StaticSite.ps1
# Add an approved AWS authentication step here.
# Prefer short-lived/federated credentials for production use.
- name: Deploy to S3
shell: pwsh
env:
S3_BUCKET: ${{ secrets.S3_BUCKET }}
run: aws s3 sync ./site "s3://$env:S3_BUCKET"