Skip to content

Commit

Permalink
chore: Add github pages build. (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion authored Jun 13, 2024
1 parent 8f867a9 commit f3447a2
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build Documentation
description: 'Build Documentation.'
inputs:
workspace_path:
description: 'Path to the workspace.'
required: true

runs:
using: composite
steps:
- name: Setup dotnet build tools
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0
- name: Install docfx
shell: bash
run: dotnet tool update -g docfx

- name: Build docs
shell: bash
run: |
docfx metadata
docfx build
4 changes: 4 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ runs:
if: steps.build.outcome == 'success' && inputs.run_tests == 'true'
shell: bash
run: dotnet test

- name: Build Documentation
if: steps.build.outcome == 'success'
uses: ./.github/actions/build-docs
15 changes: 14 additions & 1 deletion .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ description: 'Dotnet Client SDK action that packs DLLs into unsigned Nuget packa
inputs:
dry_run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true
github_token:
description: 'Required to publish github pages'
required: true

runs:
Expand All @@ -14,6 +16,10 @@ runs:
with:
dotnet-version: 7.0

- name: Build Documentation
if: steps.build.outcome == 'success'
uses: ./.github/actions/build-docs

- name: Create Nuget Package
shell: bash
run: |
Expand All @@ -37,3 +43,10 @@ runs:
for pkg in $(find ./nupkgs -name '*.nupkg' -o -name '*.snupkg'); do
echo "dry run - ${pkg}"
done
- uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.1
if: ${{ inputs.dry_run == 'false' }}
name: 'Publish to Github pages'
with:
docs_path: docs
github_token: ${{ inputs.github_token }}
23 changes: 23 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
workflow_dispatch:

name: Manual Publish Docs
jobs:
build-publish:
runs-on: ubuntu-latest
permissions:
contents: write # Needed in this case to write github pages.
steps:
- uses: actions/checkout@v4
- id: build
name: Build and Test SDK
uses: ./.github/actions/ci
with:
project_file: ${{ inputs.project_file }}
test_project_file: ${{ inputs.test_project_file }}

- uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.1
name: 'Publish to Github pages'
with:
docs_path: docs
github_token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
contents: write # Needed to publish documentation.
steps:
- uses: actions/checkout@v4

Expand All @@ -49,3 +49,4 @@ jobs:
uses: ./.github/actions/publish
with:
dry_run: ${{ inputs.dry_run }}
github_token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,7 @@ project.lock.json
# JetBrains IDEs
.idea/

# Generated documentaion
docs/
api/

45 changes: 45 additions & 0 deletions docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"metadata": [
{
"src": [
{
"src": "./src",
"files": [
"**/*.csproj",
"**/bin/**/**LaunchDarkly**.dll"
]
}
],
"dest": "./api"
}
],
"build": {
"content": [
{
"files": [
"**/*.{md,yml}"
],
"exclude": [
"docs/**"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"output": "docs",
"template": [
"default"
],
"globalMetadata": {
"_appName": "LaunchDarkly OpenFeature provider for the Server-Side SDK for .NET",
"_appTitle": "LaunchDarkly OpenFeature provider for the Server-Side SDK for .NET",
"_enableSearch": true,
"pdf": false
}
}
}
18 changes: 18 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
_layout: landing
---

# LaunchDarkly OpenFeature provider for the Server-Side SDK for .NET

For first time users, visit our [LaunchDarkly Docs](https://docs.launchdarkly.com/sdk/server-side/dotnet) page.
Within these docs, the <xref:LaunchDarkly.OpenFeature.ServerProvider.Provider> is a good starting point.

The [README](https://github.com/launchdarkly/openfeature-dotnet-server/tree/main/README.md) contains several examples which may be of use.

For source code, see the [GitHub repository](https://github.com/launchdarkly/openfeature-dotnet-server).
The [developer notes](https://github.com/launchdarkly/openfeature-dotnet-server/blob/main/CONTRIBUTING.md) there include links
to other repositories used in the SDK.

# Namespaces

<xref:LaunchDarkly.OpenFeature.ServerProvider>: Contains the provider implementation and supporting implementation.
2 changes: 2 additions & 0 deletions toc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- name: API Documentation
href: api/

0 comments on commit f3447a2

Please sign in to comment.