Skip to content

Commit 4bc00e0

Browse files
Workflows v2 (neo4j#2542) (neo4j#2577)
Updates workflows so the reference to our reusable workflows is using `v2`. When minor and patch versions are released, the `v2` tag will be kept up to date so it is always referencing the latest versions of the workflows. These are new workflows that require different `scripts` to be defined in `package.json` so that file has been updated. There are also changes in `package.json` to improve the nodemon behavior. `v2` includes a new link checker to verify links within a docset where the target includes a fragment (ie xref:page.adoc#section[]`. A warning is logged if the target section is not found. Ås a result this PR has some warnings, but they should be resolved by neo4j#2538. Co-authored-by: Neil Dewhurst <[email protected]>
1 parent 53d3ad4 commit 4bc00e0

File tree

6 files changed

+85
-79
lines changed

6 files changed

+85
-79
lines changed

.github/workflows/docs-branch-checks.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
name: "Generate and Publish HTML"
3+
4+
on:
5+
push:
6+
branches:
7+
- 'dev'
8+
workflow_dispatch:
9+
10+
env:
11+
PUBLISH_TO: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }}
12+
13+
jobs:
14+
15+
docs-build:
16+
name: Generate HTML
17+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v2
18+
with:
19+
package-script: 'verify:publish'
20+
21+
docs-verify:
22+
name: Verify HTML
23+
needs: docs-build
24+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v2
25+
with:
26+
failOnWarnings: true
27+
28+
publish-html:
29+
name: Publish HTML
30+
needs: docs-verify
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Trigger Publish
35+
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2.1.2
36+
with:
37+
token: ${{ secrets.DOCS_DISPATCH_TOKEN }}
38+
repository: neo4j/docs-publish
39+
event-type: publish-html
40+
client-payload: |-
41+
{
42+
"org": "${{ github.repository_owner }}",
43+
"repo": "${{ github.event.repository.name }}",
44+
"run_id": "${{ github.run_id }}",
45+
"args": "--dryrun",
46+
"publish_env": "${{ env.PUBLISH_TO }}"
47+
}

.github/workflows/docs-pr-checks.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@ jobs:
1313

1414
# Generate HTML
1515
docs-build-pr:
16-
uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v2.0.0-rc-1
16+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v2
1717
with:
1818
deploy-id: ${{ github.event.number }}
19-
retain-artifacts: 14
20-
antora-extensions-exclude: "@neo4j-antora/xref-hash-validator" # Exclude the xref hash validator extension
2119

2220
# Parse the json log output from the HTML build, and output warnings and errors as annotations
2321
# Optionally, fail the build if there are warnings or errors
2422
# By default, the job fails if there are errors, passes if there are warnings only.
2523
docs-verify-pr:
2624
needs: docs-build-pr
27-
uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v2.0.0-rc-1
25+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v2
2826
with:
2927
failOnWarnings: true
3028

@@ -56,7 +54,7 @@ jobs:
5654
docs-updates-comment-pr:
5755
if: needs.docs-build-pr.outputs.pages-listed == 'success'
5856
needs: [docs-build-pr, docs-changes-pr]
59-
uses: neo4j/docs-tools/.github/workflows/reusable-docs-pr-changes.yml@v2.0.0-rc-1
57+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-pr-changes.yml@v2
6058
with:
6159
pages-modified: ${{ needs.docs-changes-pr.outputs.pages-modified }}
6260
pages-added: ${{ needs.docs-changes-pr.outputs.pages-added }}

package.json

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
{
2-
"name": "docs-template",
2+
"name": "docs-operations",
33
"version": "1.0.0",
4-
"description": "Template repo for Neo4j documentation projects",
4+
"description": "Neo4j Operations documentation",
55
"main": "server.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
8-
"start": "npm update && nodemon -e adoc --exec \"npm run build && npm run serve\"",
8+
"prestart": "npm update",
9+
"start": "nodemon --exec \"npm run build\"",
910
"serve": "node server.js",
10-
"adoc-gen": "node scripts/adoc-gen.js",
11-
"build": "antora preview.yml --stacktrace --log-format=pretty",
12-
"build-verify": "antora --stacktrace --fetch preview.yml --log-format=json --log-level=info --log-file ./build/log/log.json",
13-
"publish-verify": "antora --stacktrace --fetch publish.yml --log-format=json --log-file ./build/log/log.json"
11+
"clean": "rm -rf build",
12+
"build": "npm run build:preview",
13+
"postbuild": "node server.js",
14+
"build:preview": "antora preview.yml --stacktrace --log-format=pretty",
15+
"build:publish": "npm run clean && antora publish.yml --stacktrace --log-format=pretty",
16+
"verify:preview": "antora --stacktrace --fetch preview.yml --log-format=json --log-level=info --log-file ./build/log/log.json",
17+
"verify:publish": "antora --stacktrace --fetch publish.yml --log-format=json --log-level=info --log-file ./build/log/log.json"
1418
},
1519
"keywords": [
1620
"antora",
@@ -19,23 +23,31 @@
1923
"author": "Neo4j",
2024
"license": "ISC",
2125
"dependencies": {
22-
"@antora/cli": "^3.1.7",
23-
"@antora/site-generator-default": "^3.1.7",
24-
"@neo4j-antora/antora-add-notes": "^0.3.1",
26+
"antora": "^3.1.10",
27+
"@neo4j-antora/antora-add-notes": "^0.3.2",
2528
"@neo4j-antora/antora-page-roles": "^0.3.2",
26-
"@neo4j-antora/antora-table-footnotes": "^0.3.2",
2729
"@neo4j-antora/antora-unlisted-pages": "^0.1.0",
28-
"@neo4j-antora/roles-labels": "^0.1.0-beta.2",
29-
"@neo4j-documentation/macros": "^1.0.2",
30+
"@neo4j-antora/roles-labels": "^0.1.1",
31+
"@neo4j-antora/table-footnotes": "^1.0.0",
32+
"@neo4j-antora/xref-hash-validator": "^0.1.3",
33+
"@neo4j-documentation/macros": "^1.0.4",
3034
"@neo4j-documentation/remote-include": "^1.0.0"
3135
},
3236
"devDependencies": {
3337
"express": "^5.1.0",
3438
"nodemon": "^3.1.0"
3539
},
36-
"overrides": {
37-
"@antora/site-generator-default": {
38-
"glob-parent": "6.0.2"
39-
}
40+
"nodemonConfig": {
41+
"watch": [
42+
"**/modules/**",
43+
"**/antora.yml",
44+
"**/preview.yml",
45+
"**/publish.yml"
46+
],
47+
"ext": "yml,yaml,adoc,svg,png,jpg",
48+
"ignore": [
49+
"build",
50+
"node_modules"
51+
]
4052
}
4153
}

preview.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@ urls:
2424

2525
antora:
2626
extensions:
27-
- require: "@neo4j-antora/antora-unlisted-pages"
27+
- "@neo4j-antora/antora-unlisted-pages"
2828
- "@neo4j-antora/roles-labels"
29+
- "@neo4j-antora/table-footnotes"
30+
- "@neo4j-antora/xref-hash-validator"
2931

3032
asciidoc:
3133
extensions:
3234
- "@neo4j-documentation/remote-include"
3335
- "@neo4j-documentation/macros"
3436
- "@neo4j-antora/antora-add-notes"
3537
- "@neo4j-antora/antora-page-roles"
36-
- "@neo4j-antora/antora-table-footnotes"
3738
attributes:
3839
page-theme: docs
3940
page-type: Docs

publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ urls:
2525

2626
antora:
2727
extensions:
28-
- require: "@neo4j-antora/antora-unlisted-pages"
28+
- "@neo4j-antora/antora-unlisted-pages"
2929
- "@neo4j-antora/roles-labels"
30+
- "@neo4j-antora/table-footnotes"
31+
- "@neo4j-antora/xref-hash-validator"
3032

3133
asciidoc:
3234
extensions:
3335
- "@neo4j-documentation/remote-include"
3436
- "@neo4j-documentation/macros"
3537
- "@neo4j-antora/antora-add-notes"
3638
- "@neo4j-antora/antora-page-roles"
37-
- "@neo4j-antora/antora-table-footnotes"
3839
attributes:
3940
page-theme: docs
4041
page-type: Docs

0 commit comments

Comments
 (0)