Skip to content

Add GitHub Actions workflow to build website via Nuke and Jekyll#391

Draft
Copilot wants to merge 6 commits intomasterfrom
copilot/create-gha-build-for-website
Draft

Add GitHub Actions workflow to build website via Nuke and Jekyll#391
Copilot wants to merge 6 commits intomasterfrom
copilot/create-gha-build-for-website

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 9, 2026

Adds .github/workflows/build.yml — a CI workflow that runs on every push and pull request to master with two independent parallel jobs:

Nuke build job (windows-latest):

  • Converts the PSake script (Build/default.ps1) into a C#/Nuke build project (build/_build.csproj + build/Build.cs) using Nuke.Common
  • Replicates all five PSake tasks: Clean, ExtractVersionsFromGit, Compile, CompileCheatsheet, and BuildHtml
  • Uses Nuke's built-in GitVersionTasks (with SetProcessToolPath pointing to the bundled Lib/GitVersion.exe) instead of raw process invocation
  • Calls the bundled Lib/Pandoc/pandoc.exe for HTML generation (requires fetch-depth: 0 for GitVersion)
  • Invoked via the standard Nuke bootstrap script: .\build.ps1 Default

Jekyll build job (ubuntu-latest):

  • Runs the JekyllBuild Nuke target via ./build.sh JekyllBuild to verify the static site compiles correctly
  • The JekyllBuild Nuke target handles the full Jekyll setup: runs bundle install then bundle exec jekyll build — no Ruby tooling configured in the workflow YAML

Key details:

  • The two jobs are independent and run in parallel — Nuke produces standalone HTML artifacts; Jekyll builds the static website from the same Markdown sources
  • GITHUB_TOKEN permissions are restricted to contents: read on both jobs
  • Standard Nuke bootstrap scripts (build.ps1 / build.sh) handle .NET SDK detection and installation automatically — no separate setup-dotnet step needed
  • Nuke build artifacts (build/bin/, build/obj/) and the Nuke temp directory (.nuke/temp/) are excluded via .gitignore

@dennisdoomen
Copy link
Copy Markdown
Owner

@copilot

  1. Convert the PSake script into a C#/Nuke build project. See https://github.com/nuke-build/nuke
  2. Don't only run the new C#/Nuke project, I also want you to use the Jekyll steps to make sure the site can be build correctly with the bundler and such

Copilot AI and others added 2 commits April 9, 2026 19:49
Copy link
Copy Markdown
Author

Copilot AI commented Apr 9, 2026

@copilot

  1. Convert the PSake script into a C#/Nuke build project. See https://github.com/nuke-build/nuke
  2. Don't only run the new C#/Nuke project, I also want you to use the Jekyll steps to make ...

Done in commit 55d76a8.

Nuke build project (build/_build.csproj + build/Build.cs): Converts the PSake script into a C#/Nuke build with the same five tasks — Clean, ExtractVersionsFromGit, Compile, CompileCheatsheet, and BuildHtml. It calls the bundled Lib/GitVersion.exe and Lib/Pandoc/pandoc.exe exactly as the PSake script did.

Jekyll steps added: A new jekyll job on ubuntu-latest runs bundle exec jekyll build via ruby/setup-ruby@v1 with bundler cache. The two CI jobs are independent and run in parallel — Nuke produces standalone HTML artifacts; Jekyll builds the static site from the same Markdown sources.

Updated workflow:

jobs:
  build:          # windows-latest: dotnet run --project build/_build.csproj -- Default
  jekyll:         # ubuntu-latest:  bundle exec jekyll build

Copilot AI changed the title Add GitHub Actions workflow to build website via Build.bat Add GitHub Actions workflow to build website via Nuke and Jekyll Apr 9, 2026
Copilot AI requested a review from dennisdoomen April 9, 2026 19:51
# - Nuke compiles the guidelines into standalone HTML documents using Pandoc
# - Jekyll builds the static website from the same source Markdown files
# They share no artifacts and can run in parallel.
jekyll:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want this to be part of the Nuke script as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 509774e. Added a JekyllBuild target to build/Build.cs:

Target JekyllBuild => _ => _
    .Executes(() =>
    {
        ProcessTasks.StartProcess("bundle", "exec jekyll build", RootDirectory)
            .AssertZeroExitCode();
    });

The jekyll CI job now invokes this via ./build.sh JekyllBuild instead of calling bundle exec jekyll build directly.

Copy link
Copy Markdown
Owner

@dennisdoomen dennisdoomen Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Then you can remove it from the build.yml, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit f16399c. ruby/setup-ruby@v1 is removed from the workflow. The jekyll job now just does checkout + ./build.sh JekyllBuild.

with:
fetch-depth: 0

- uses: actions/setup-dotnet@v4
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed as the Nuke build.ps1 should do this for you.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 509774e. The actions/setup-dotnet@v4 step has been removed. build.ps1 detects dotnet on PATH (GitHub runners already have it) and falls back to downloading and installing it only when needed.

dotnet-version: '8.0.x'

- name: Run Nuke build
run: dotnet run --project build/_build.csproj -- Default
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the standard build.ps1 Nuke adds to a project

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 509774e. Added the standard Nuke bootstrap scripts (build.ps1 for Windows, build.sh for Unix) taken from Nuke's official template. The workflow now uses .\build.ps1 Default for the Windows build job and ./build.sh JekyllBuild for the Linux Jekyll job.

build/Build.cs Outdated
.DependsOn(Clean)
.Executes(() =>
{
var gitVersionExe = LibDirectory / "GitVersion.exe";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitVersion is a built-in feature of Nuke. Use that instead.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 509774e. Replaced ProcessTasks.StartProcess with GitVersionTasks.GitVersion() from Nuke.Common.Tools.GitVersion, using SetProcessToolPath to point to the bundled Lib/GitVersion.exe:

var result = GitVersionTasks.GitVersion(s => s
    .SetProcessToolPath(LibDirectory / "GitVersion.exe")
    .SetProcessWorkingDirectory(RootDirectory));

semVer = result.Result.SemVer;
commitDate = DateTime.Parse(result.Result.CommitDate).ToString("MMMM d, yyyy");

contents: read

steps:
- uses: actions/checkout@v4
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Running Jekyll should also become part of the Nuke script

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit f16399c. bundle install is now part of the JekyllBuild Nuke target, so the Nuke script handles the full Jekyll setup:

Target JekyllBuild => _ => _
    .Executes(() =>
    {
        ProcessTasks.StartProcess("bundle", "install", RootDirectory)
            .AssertZeroExitCode();

        ProcessTasks.StartProcess("bundle", "exec jekyll build", RootDirectory)
            .AssertZeroExitCode();
    });

…uby from workflow

Agent-Logs-Url: https://github.com/dennisdoomen/CSharpGuidelines/sessions/5b7725a1-5ddb-4b6d-97e4-804973568313

Co-authored-by: dennisdoomen <572734+dennisdoomen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants