Skip to content

Commit e129082

Browse files
committed
Provisionally resolve #367 - Improved docs publishing
The only way to test this is on master. Hence committing straight into it.
1 parent f1e1d4f commit e129082

2 files changed

Lines changed: 62 additions & 51 deletions

File tree

.github/workflows/publishDocsWebsite.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/releaseBuild.yml

Lines changed: 62 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,12 @@ jobs:
4747
with:
4848
name: Build results (NuGet)
4949
path: packages/*.nupkg
50-
- name: Publish packages to GitHub feed
51-
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }}
52-
run: |
53-
dotnet nuget add source --username ${{ env.GithubNugetUsername }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/csf-dev/index.json"
54-
for package in packages/*.nupkg
55-
do
56-
dotnet nuget push $package --source github
57-
done
5850

5951
build_docs_site:
6052
name: Build the documentation website
6153
runs-on: ubuntu-24.04
6254
timeout-minutes: 30
63-
if: ${{ github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' }}
55+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
6456

6557
steps:
6658
- name: Checkout
@@ -83,7 +75,7 @@ jobs:
8375
path: docs/**/*
8476

8577
publish_nuget:
86-
name: Publish packages to NuGet
78+
name: Publish new Release (Github & NuGet)
8779
runs-on: ubuntu-slim
8880
if: ${{ github.event_name == 'push' }}
8981
needs: build_and_pack
@@ -150,3 +142,63 @@ jobs:
150142
prerelease: ${{ steps.get-release-props.outputs.prerelease }}
151143
body_path: release_notes.md
152144
generate_release_notes: true
145+
146+
publish_github:
147+
name: Publish packages to GitHub
148+
runs-on: ubuntu-slim
149+
needs: build_and_pack
150+
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }}
151+
152+
env:
153+
GithubNugetUsername: craigfowler
154+
155+
steps:
156+
- name: Add .NET global tools location to PATH
157+
run: echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
158+
shell: bash
159+
- name: Install .NET
160+
uses: actions/setup-dotnet@v5
161+
with:
162+
dotnet-version: 8.0.x
163+
- name: Get release artifacts
164+
uses: actions/download-artifact@v8
165+
with:
166+
name: Build results (NuGet)
167+
path: ./packages
168+
- name: Publish packages to GitHub feed
169+
run: |
170+
dotnet nuget add source --username ${{ env.GithubNugetUsername }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/csf-dev/index.json"
171+
for package in packages/*.nupkg
172+
do
173+
dotnet nuget push $package --api-key ${{ secrets.GITHUB_TOKEN }} --source github
174+
done
175+
176+
update_docs_website:
177+
name: Update docs website
178+
runs-on: ubuntu-slim
179+
needs: build_docs_site
180+
if: ${{ github.event_name != 'pull_request' && github.ref_name == 'master' }}
181+
182+
steps:
183+
- name: Checkout
184+
uses: actions/checkout@v6
185+
with:
186+
fetch-depth: 0
187+
lfs: true
188+
- name: Remove old docs
189+
run: dotnet clean CSF.Screenplay.Docs
190+
- name: Get release artifacts
191+
uses: actions/download-artifact@v8
192+
with:
193+
name: Docs website
194+
path: ./docs
195+
- name: Add & Commit
196+
uses: EndBug/add-and-commit@v9.1.4
197+
with:
198+
add: -A docs/
199+
default_author: github_actor
200+
committer_name: Github Actions Workflow (bot)
201+
committer_email: github-actions-workflow@bots.noreply.github.com
202+
fetch: true
203+
message: Publish updated documentation website
204+
push: origin master

0 commit comments

Comments
 (0)