Skip to content

Commit

Permalink
update some inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Aug 21, 2024
1 parent b40dd4b commit f011d63
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/doctum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ on:
type: string
default: "Reference Documentation"
required: true
default_tag:
theme:
type: string
description: "The version tag to use as the latest version."
exclude_file:
description: "doctum theme"
default: default
default_version:
type: string
description: "exclude a file from documentation"
description: "The version tag to use as the latest version."
tag_pattern:
type: string
description: "tags to include in version selector"
default: "v1.*"
dry_run:
type: boolean
description: "do not deploy to gh-pages"
theme:
type: string
description: "doctum theme"
default: default
exclude_file:
type: string
description: "exclude a file from documentation"

permissions:
contents: write
Expand Down Expand Up @@ -63,9 +63,12 @@ jobs:
->in(__DIR__ . '/src');
$versions = GitVersionCollection::create(__DIR__);
empty('${{ inputs.tag_pattern }}')
? $versions->add('main', 'main')
: $versions->addFromTags('${{ inputs.tag_pattern }}');
if ('${{ inputs.tag_pattern }}') {
$versions->addFromTags('${{ inputs.tag_pattern }}');
}
if ('${{ inputs.default_version }}') {
$versions->add('${{ inputs.default_version }}', '${{ inputs.default_version }}');
}
return new Doctum($iterator, [
'title' => '${{ inputs.title }}',
Expand All @@ -84,11 +87,11 @@ jobs:
- name: Run Doctum to Generate Documentation
run: |
php doctum.phar update doctum-config.php --ignore-parse-errors
- if: inputs.default_tag
- if: inputs.default_version
name: Redirect Index to Latest Version
run: |
cat << EOF > .build/index.html
<meta http-equiv='refresh' content='0;url=/${{ github.event.repository.name }}/${{ inputs.default_tag }}'>
<meta http-equiv='refresh' content='0;url=/${{ github.event.repository.name }}/${{ inputs.default_version }}'>
EOF
- if: ${{ !inputs.dry_run }}
name: Move generated files into GitHub Pages branch
Expand Down

0 comments on commit f011d63

Please sign in to comment.