Skip to content

Commit 621e712

Browse files
committed
Added: Ability to build to a specific location.
1 parent c5ca957 commit 621e712

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

README.MD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ The action supports the following input parameters:
7070
- `CONFIG_FILE`: (Optional) The path to your MkDocs configuration file. Defaults to `mkdocs.yml` in the repository root.
7171
- `PUBLISH_TO_PAGES`: (Optional) Whether to publish the generated site to GitHub Pages. Defaults to `true`.
7272
- `CHECKOUT_CURRENT_REPO`: (Optional) Whether to perform a repository checkout before building the site. Defaults to `true`.
73+
- `OUTPUT_DIRECTORY`: (Optional) Location of the built MkDocs site. Defaults to `./site`.
7374
- `PRE_BUILD_SCRIPT`: (Optional) The path to a pre-build script to run before building the site.
7475
- `PRE_BUILD_SHELL`: (Optional) The shell to use for running the pre-build script. Defaults to `bash`.
7576

action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Build and Deploy MkDocs Material (Reloaded)
2+
description: Builds and/or Deploys MkDocs Material to GitHub Pages, or a Directory
23

34
inputs:
45
MKDOCS_VERSION:
@@ -35,6 +36,11 @@ inputs:
3536
required: false
3637
default: "bash"
3738
description: "Shell to use for running the pre-build script"
39+
OUTPUT_DIRECTORY:
40+
type: string
41+
required: false
42+
default: "./site"
43+
description: "Custom output directory for the MkDocs build"
3844

3945
runs:
4046
using: "composite"
@@ -73,14 +79,14 @@ runs:
7379
7480
- name: Build MkDocs Site
7581
shell: bash
76-
run: mkdocs build --config-file "${{ inputs.CONFIG_FILE }}"
82+
run: mkdocs build --config-file "${{ inputs.CONFIG_FILE }}" --site-dir "${{ inputs.OUTPUT_DIRECTORY }}" # Updated command
7783

7884
- name: Upload pages artifact
7985
if: ${{ inputs.PUBLISH_TO_PAGES }}
8086
uses: actions/upload-pages-artifact@v3
8187
with:
8288
name: "github-pages"
83-
path: "./site"
89+
path: "${{ inputs.OUTPUT_DIRECTORY }}"
8490

8591
- name: Deploy to GitHub Pages
8692
if: ${{ inputs.PUBLISH_TO_PAGES }}

0 commit comments

Comments
 (0)