Skip to content

Commit b5643d2

Browse files
committed
added artifact shaering
1 parent 1952909 commit b5643d2

3 files changed

Lines changed: 22 additions & 11 deletions

File tree

.github/actions/generate-docs/action.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ author: 'Pete Sramek'
33
description: 'Generate documentation using docfx'
44
inputs:
55
# Required
6+
artifact-name:
7+
description: 'Name of the artifact to upload after generating documentation'
8+
required: true
69
docfx-json-manifest:
710
description: 'Path to the docfx JSON manifest file'
811
required: true
@@ -39,9 +42,8 @@ runs:
3942
- name: 'Move files from staging to target directory'
4043
run: mv ${{ inputs.staging-directory }} ${{ inputs.target-directory }}
4144
shell: bash
42-
- name: 'Push documentation to docs branch'
43-
uses: ./.github/actions/push-changes
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
4447
with:
45-
working-directory: ${{ inputs.target-directory }}
46-
target-branch: 'docs'
47-
commit-message: 'Update docs'
48+
name: ${{ inputs.artifact-name }}
49+
path: './docs'

.github/actions/push-changes/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ author: 'Pete Sramek'
33
description: 'Push changes to a specified branch in the repository.'
44
inputs:
55
# Required
6+
artifact-name:
7+
description: 'Name of the artifact to download before pushing changes.'
8+
required: true
69
working-directory:
710
description: 'The working directory where the changes will be pushed from.'
811
required: true
@@ -27,6 +30,10 @@ runs:
2730
uses: actions/setup-dotnet@v4
2831
with:
2932
dotnet-version: ${{ env.dotnet-sdk-version }}
33+
- name: Download a single artifact
34+
uses: actions/download-artifact@v4
35+
with:
36+
name: ${{ inputs.artifact-name }}
3037
- name: Add changes from ${{ inputs.working-directory }}
3138
shell: bash
3239
run: |

.github/workflows/build.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,17 @@ jobs:
214214
- name: 'Generate documentation'
215215
uses: ./.github/actions/generate-docs
216216
with:
217+
artifact-name: 'docs'
217218
docfx-json-manifest: './docfx/api-reference.json'
218219
staging-directory: './docs/temp/**'
219220
target-directory: './docs/${{ env.friendly-version }}/'
220-
# - name: 'Push documentation to docs branch'
221-
# uses: ./.github/actions/push-changes
222-
# with:
223-
# working-directory: './docs/${{ env.friendly-version }}/'
224-
# target-branch: 'docs'
225-
# commit-message: 'Update docs for version ${{ env.friendly-version }}'
221+
- name: 'Push documentation to docs branch'
222+
uses: ./.github/actions/push-changes
223+
with:
224+
artifact-name: 'docs'
225+
working-directory: './docs/${{ env.friendly-version }}/'
226+
target-branch: 'docs'
227+
commit-message: 'Update docs for version ${{ env.friendly-version }}'
226228
# - name: Upload artifact
227229
# uses: actions/upload-pages-artifact@v3
228230
# with:

0 commit comments

Comments
 (0)