Antora (#462)
* Use providers.provider for modifiedFile This defers the looking up of modifiedFiles until it is used. It also allows other tasks to be ran from the non-primary worktree. Working in another worktree is essential for Antora which will clone each branch/tag into a new worktree to process it. * Move Asdiidoc Attributes to antora.yml This ensures the attributes are available for the docs-build branch as well. * Fix GitHub Actions Permissions The permission actions: write is necessary so that pushes to branches and tags can invoke the deploy-docs workflow on the docs-build branch
This commit is contained in:
3
.github/workflows/deploy-docs-antora.yml
vendored
3
.github/workflows/deploy-docs-antora.yml
vendored
@@ -4,7 +4,8 @@ on:
|
||||
branches-ignore: [ gh-pages ]
|
||||
tags: '**'
|
||||
workflow_dispatch:
|
||||
permissions: read-all
|
||||
permissions:
|
||||
actions: write
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -6,7 +6,7 @@ if (gitPresent) {
|
||||
|
||||
ext {
|
||||
if (gitPresent) {
|
||||
modifiedFiles = files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') }
|
||||
modifiedFiles = providers.provider { files(grgit.status().unstaged.modified).filter{ f -> f.name.endsWith('.java') } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ project.afterEvaluate {
|
||||
else {
|
||||
onlyIf { gitPresent && !System.getenv('GITHUB_ACTION') }
|
||||
if (gitPresent) {
|
||||
inputs.files(modifiedFiles.filter { f -> f.path.contains(subproject.name) })
|
||||
inputs.files(modifiedFiles.map(files -> files.filter { f -> f.path.contains(subproject.name) }))
|
||||
}
|
||||
}
|
||||
outputs.dir('build')
|
||||
|
||||
@@ -26,8 +26,6 @@ asciidoc:
|
||||
hide-uri-scheme: '@'
|
||||
tabs-sync-option: '@'
|
||||
chomp: 'all'
|
||||
listener-class: PulsarListener@
|
||||
template-class: PulsarTemplate@
|
||||
extensions:
|
||||
- '@asciidoctor/tabs'
|
||||
- '@springio/asciidoctor-extensions'
|
||||
|
||||
@@ -10,3 +10,7 @@ ext:
|
||||
local: true
|
||||
scan:
|
||||
dir: spring-pulsar-docs/build/generated-antora-resources
|
||||
asciidoc:
|
||||
attributes:
|
||||
listener-class: PulsarListener@
|
||||
template-class: PulsarTemplate@
|
||||
|
||||
Reference in New Issue
Block a user