Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Restore
run: dotnet restore

- name: Build
run: dotnet build --no-restore -c Release

- name: Test
run: dotnet test --no-build -c Release --verbosity normal
32 changes: 32 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy to GitHub Pages

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Generate index.json
run: dotnet run scripts/GenerateIndex.cs -- src/BoneLog.Blazor/wwwroot/data/posts src/BoneLog.Blazor/wwwroot/data/index.json

- name: Publish Blazor app
run: dotnet publish src/BoneLog.Blazor/BoneLog.Blazor.csproj -c Release -o release --nologo

- name: Add .nojekyll
run: touch release/wwwroot/.nojekyll

- name: Deploy to gh-pages branch
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: release/wwwroot
clean: true
43 changes: 0 additions & 43 deletions .github/workflows/full-build.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/generate-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Generate Index

on:
workflow_call:
inputs:
posts-dir:
description: Directory containing post markdown files
required: true
type: string
index-out:
description: Output path for index.json
required: true
type: string
commit-changes:
description: Commit index files back to the repository
required: false
type: boolean
default: false

jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Generate index.json
run: dotnet run scripts/GenerateIndex.cs -- ${{ inputs.posts-dir }} ${{ inputs.index-out }}

- name: Commit index files
if: inputs.commit-changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: chore: update index.json
file_pattern: |
src/BoneLog.Blazor/wwwroot/data/index.json
src/BoneLog.Blazor/wwwroot/data/index.manifest.json
22 changes: 22 additions & 0 deletions .github/workflows/index-on-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Update index on main

on:
push:
branches: [master, main]
paths:
- 'src/BoneLog.Blazor/wwwroot/data/posts/**'
- 'scripts/**'
workflow_dispatch:

permissions:
contents: write

jobs:
index:
uses: ./.github/workflows/generate-index.yml
permissions:
contents: write
with:
posts-dir: src/BoneLog.Blazor/wwwroot/data/posts
index-out: src/BoneLog.Blazor/wwwroot/data/index.json
commit-changes: true
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Generate index.json
run: dotnet run scripts/GenerateIndex.cs -- src/BoneLog.Blazor/wwwroot/data/posts src/BoneLog.Blazor/wwwroot/data/index.json

- name: Publish Blazor app
run: dotnet publish src/BoneLog.Blazor/BoneLog.Blazor.csproj -c Release -o release --nologo

- name: Add .nojekyll
run: touch release/wwwroot/.nojekyll

- name: Create site archive
run: |
cd release/wwwroot
zip -r ../../bonelog-site.zip .

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: bonelog-site.zip
generate_release_notes: true

- name: Deploy to gh-pages branch
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: release/wwwroot
clean: true
31 changes: 0 additions & 31 deletions .github/workflows/test.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/update-wwwroot.yml

This file was deleted.

19 changes: 17 additions & 2 deletions BoneLog.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
# Visual Studio Version 18
VisualStudioVersion = 18.6.11806.211
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
EndProject
Expand All @@ -11,6 +11,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9C8CDFCA-7
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BoneLog.Tests", "test\BoneLog.Tests\BoneLog.Tests.csproj", "{ADC7FA48-B270-4B4F-8AC1-E1B885612536}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BoneLog", "src\BoneLog\BoneLog.csproj", "{339F10EE-430B-4B14-A2F0-582486225567}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -45,13 +47,26 @@ Global
{ADC7FA48-B270-4B4F-8AC1-E1B885612536}.Release|x64.Build.0 = Release|Any CPU
{ADC7FA48-B270-4B4F-8AC1-E1B885612536}.Release|x86.ActiveCfg = Release|Any CPU
{ADC7FA48-B270-4B4F-8AC1-E1B885612536}.Release|x86.Build.0 = Release|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Debug|Any CPU.Build.0 = Debug|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Debug|x64.ActiveCfg = Debug|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Debug|x64.Build.0 = Debug|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Debug|x86.ActiveCfg = Debug|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Debug|x86.Build.0 = Debug|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Release|Any CPU.ActiveCfg = Release|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Release|Any CPU.Build.0 = Release|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Release|x64.ActiveCfg = Release|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Release|x64.Build.0 = Release|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Release|x86.ActiveCfg = Release|Any CPU
{339F10EE-430B-4B14-A2F0-582486225567}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{05399B60-9B81-411D-ADBA-C23B0F37E7FA} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{ADC7FA48-B270-4B4F-8AC1-E1B885612536} = {9C8CDFCA-7503-4193-A32A-5AC7ED985175}
{339F10EE-430B-4B14-A2F0-582486225567} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {10272B7A-92FA-4BBD-A6B7-1E65BD5617B4}
Expand Down
Loading
Loading