Skip to content

Commit f60b0e5

Browse files
recrwplayrenetapopova
authored andcommitted
Workflows v2 (neo4j#2542)
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.
1 parent c824040 commit f60b0e5

File tree

6 files changed

+93
-83
lines changed

6 files changed

+93
-83
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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@ jobs:
1313

1414
# Generate HTML
1515
docs-build-pr:
16-
uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v1.2.0
16+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v2
1717
with:
1818
deploy-id: ${{ github.event.number }}
19-
retain-artifacts: 14
2019

2120
# Parse the json log output from the HTML build, and output warnings and errors as annotations
2221
# Optionally, fail the build if there are warnings or errors
2322
# By default, the job fails if there are errors, passes if there are warnings only.
2423
docs-verify-pr:
2524
needs: docs-build-pr
26-
uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v1.2.0
25+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v2
2726
with:
2827
failOnWarnings: true
2928

@@ -55,7 +54,7 @@ jobs:
5554
docs-updates-comment-pr:
5655
if: needs.docs-build-pr.outputs.pages-listed == 'success'
5756
needs: [docs-build-pr, docs-changes-pr]
58-
uses: neo4j/docs-tools/.github/workflows/reusable-docs-pr-changes.yml@v1.2.0
57+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-pr-changes.yml@v2
5958
with:
6059
pages-modified: ${{ needs.docs-changes-pr.outputs.pages-modified }}
6160
pages-added: ${{ needs.docs-changes-pr.outputs.pages-added }}

package.json

Lines changed: 34 additions & 16 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": "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,17 +23,31 @@
1923
"author": "Neo4j",
2024
"license": "ISC",
2125
"dependencies": {
22-
"@antora/cli": "^3.1.1",
23-
"@antora/site-generator-default": "^3.1.1",
24-
"@neo4j-antora/antora-add-notes": "^0.1.6",
25-
"@neo4j-antora/antora-modify-sitemaps": "^0.4.4",
26-
"@neo4j-antora/antora-page-roles": "^0.3.1",
27-
"@neo4j-antora/antora-table-footnotes": "^0.3.2",
28-
"@neo4j-documentation/macros": "^1.0.2",
26+
"antora": "^3.1.10",
27+
"@neo4j-antora/antora-add-notes": "^0.3.2",
28+
"@neo4j-antora/antora-page-roles": "^0.3.2",
29+
"@neo4j-antora/antora-unlisted-pages": "^0.1.0",
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",
2934
"@neo4j-documentation/remote-include": "^1.0.0"
3035
},
3136
"devDependencies": {
32-
"express": "^4.18.1",
33-
"nodemon": "^2.0.19"
37+
"express": "^5.1.0",
38+
"nodemon": "^3.1.0"
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+
]
3452
}
3553
}

preview.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,17 @@ urls:
2323

2424
antora:
2525
extensions:
26-
- require: "@neo4j-antora/antora-modify-sitemaps"
27-
sitemap_version: '4.4'
28-
sitemap_loc_version: 'current'
29-
move_sitemaps_to_components: true
26+
- "@neo4j-antora/antora-unlisted-pages"
27+
- "@neo4j-antora/roles-labels"
28+
- "@neo4j-antora/table-footnotes"
29+
- "@neo4j-antora/xref-hash-validator"
3030

3131
asciidoc:
3232
extensions:
3333
- "@neo4j-documentation/remote-include"
3434
- "@neo4j-documentation/macros"
3535
- "@neo4j-antora/antora-add-notes"
3636
- "@neo4j-antora/antora-page-roles"
37-
- "@neo4j-antora/antora-table-footnotes"
3837
attributes:
3938
page-theme: docs
4039
page-type: Docs

publish.yml

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

2525
antora:
2626
extensions:
27-
- require: "@neo4j-antora/antora-modify-sitemaps"
28-
sitemap_version: '4.4'
29-
sitemap_loc_version: 'current'
30-
move_sitemaps_to_components: true
27+
- "@neo4j-antora/antora-unlisted-pages"
28+
- "@neo4j-antora/roles-labels"
29+
- "@neo4j-antora/table-footnotes"
30+
- "@neo4j-antora/xref-hash-validator"
3131

3232
asciidoc:
3333
extensions:
3434
- "@neo4j-documentation/remote-include"
3535
- "@neo4j-documentation/macros"
3636
- "@neo4j-antora/antora-add-notes"
37-
- "@neo4j-antora/antora-table-footnotes"
37+
- "@neo4j-antora/antora-page-roles"
3838
attributes:
3939
page-theme: docs
4040
page-type: Docs

0 commit comments

Comments
 (0)