diff --git a/.github/workflows/docs-branch-checks.yml b/.github/workflows/docs-branch-checks.yml deleted file mode 100644 index 72f98fc99..000000000 --- a/.github/workflows/docs-branch-checks.yml +++ /dev/null @@ -1,53 +0,0 @@ -# This is an example of the docs-pr.yml workflow available from the recrwplay org -name: "Verify Branch" - -on: - # push: - # branches: - # - dev - # schedule: - # - cron: '00 16 * * *' - workflow_dispatch: - inputs: - html: - description: 'Generate HTML' - type: boolean - required: false - default: true - links: - description: 'Check links' - type: boolean - required: false - default: true - lint: - description: 'Lint docs' - type: boolean - required: false - default: false - -jobs: - - docs-build: - if: ${{ inputs.html || github.event_name == 'push' }} - name: Generate HTML - uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v2.0.0-rc-1 - with: - retain-artifacts: 14 - deploy-id: 0 - - docs-verify: - name: Verify HTML - needs: docs-build - uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v2.0.0-rc-1 - - docs-links: - if: ${{ inputs.links || github.event_name == 'push' }} - name: Check links - needs: docs-build - uses: neo4j/docs-tools/.github/workflows/reusable-docs-links.yml@v2.0.0-rc-1 - - docs-lint: - if: ${{ inputs.lint || github.event_name == 'push' }} - name: Lint docs - uses: neo4j/docs-tools/.github/workflows/reusable-docs-lint.yml@v2.0.0-rc-1 - diff --git a/.github/workflows/docs-generate-html.yml b/.github/workflows/docs-generate-html.yml new file mode 100644 index 000000000..a6f954ae9 --- /dev/null +++ b/.github/workflows/docs-generate-html.yml @@ -0,0 +1,47 @@ + +name: "Generate and Publish HTML" + +on: + push: + branches: + - 'dev' + workflow_dispatch: + +env: + PUBLISH_TO: ${{ github.ref == 'refs/heads/main' && 'prod' || 'dev' }} + +jobs: + + docs-build: + name: Generate HTML + uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v2 + with: + package-script: 'verify:publish' + + docs-verify: + name: Verify HTML + needs: docs-build + uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v2 + with: + failOnWarnings: true + + publish-html: + name: Publish HTML + needs: docs-verify + runs-on: ubuntu-latest + + steps: + - name: Trigger Publish + uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2.1.2 + with: + token: ${{ secrets.DOCS_DISPATCH_TOKEN }} + repository: neo4j/docs-publish + event-type: publish-html + client-payload: |- + { + "org": "${{ github.repository_owner }}", + "repo": "${{ github.event.repository.name }}", + "run_id": "${{ github.run_id }}", + "args": "--dryrun", + "publish_env": "${{ env.PUBLISH_TO }}" + } diff --git a/.github/workflows/docs-pr-checks.yml b/.github/workflows/docs-pr-checks.yml index 0dfcdfeca..4d9ccc47e 100644 --- a/.github/workflows/docs-pr-checks.yml +++ b/.github/workflows/docs-pr-checks.yml @@ -13,18 +13,16 @@ jobs: # Generate HTML docs-build-pr: - uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v2.0.0-rc-1 + uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v2 with: deploy-id: ${{ github.event.number }} - retain-artifacts: 14 - antora-extensions-exclude: "@neo4j-antora/xref-hash-validator" # Exclude the xref hash validator extension # Parse the json log output from the HTML build, and output warnings and errors as annotations # Optionally, fail the build if there are warnings or errors # By default, the job fails if there are errors, passes if there are warnings only. docs-verify-pr: needs: docs-build-pr - uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v2.0.0-rc-1 + uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v2 with: failOnWarnings: true @@ -56,7 +54,7 @@ jobs: docs-updates-comment-pr: if: needs.docs-build-pr.outputs.pages-listed == 'success' needs: [docs-build-pr, docs-changes-pr] - uses: neo4j/docs-tools/.github/workflows/reusable-docs-pr-changes.yml@v2.0.0-rc-1 + uses: neo4j/docs-tools/.github/workflows/reusable-docs-pr-changes.yml@v2 with: pages-modified: ${{ needs.docs-changes-pr.outputs.pages-modified }} pages-added: ${{ needs.docs-changes-pr.outputs.pages-added }} diff --git a/package.json b/package.json index ae22c8992..ef48a1f06 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,20 @@ { - "name": "docs-template", + "name": "docs-operations", "version": "1.0.0", - "description": "Template repo for Neo4j documentation projects", + "description": "Neo4j Operations documentation", "main": "server.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "start": "npm update && nodemon -e adoc --exec \"npm run build && npm run serve\"", + "prestart": "npm update", + "start": "nodemon --exec \"npm run build\"", "serve": "node server.js", - "adoc-gen": "node scripts/adoc-gen.js", - "build": "antora preview.yml --stacktrace --log-format=pretty", - "build-verify": "antora --stacktrace --fetch preview.yml --log-format=json --log-level=info --log-file ./build/log/log.json", - "publish-verify": "antora --stacktrace --fetch publish.yml --log-format=json --log-file ./build/log/log.json" + "clean": "rm -rf build", + "build": "npm run build:preview", + "postbuild": "node server.js", + "build:preview": "antora preview.yml --stacktrace --log-format=pretty", + "build:publish": "npm run clean && antora publish.yml --stacktrace --log-format=pretty", + "verify:preview": "antora --stacktrace --fetch preview.yml --log-format=json --log-level=info --log-file ./build/log/log.json", + "verify:publish": "antora --stacktrace --fetch publish.yml --log-format=json --log-level=info --log-file ./build/log/log.json" }, "keywords": [ "antora", @@ -19,23 +23,31 @@ "author": "Neo4j", "license": "ISC", "dependencies": { - "@antora/cli": "^3.1.7", - "@antora/site-generator-default": "^3.1.7", - "@neo4j-antora/antora-add-notes": "^0.3.1", + "antora": "^3.1.10", + "@neo4j-antora/antora-add-notes": "^0.3.2", "@neo4j-antora/antora-page-roles": "^0.3.2", - "@neo4j-antora/antora-table-footnotes": "^0.3.2", "@neo4j-antora/antora-unlisted-pages": "^0.1.0", - "@neo4j-antora/roles-labels": "^0.1.0-beta.2", - "@neo4j-documentation/macros": "^1.0.2", + "@neo4j-antora/roles-labels": "^0.1.1", + "@neo4j-antora/table-footnotes": "^1.0.0", + "@neo4j-antora/xref-hash-validator": "^0.1.3", + "@neo4j-documentation/macros": "^1.0.4", "@neo4j-documentation/remote-include": "^1.0.0" }, "devDependencies": { "express": "^5.1.0", "nodemon": "^3.1.0" }, - "overrides": { - "@antora/site-generator-default": { - "glob-parent": "6.0.2" - } + "nodemonConfig": { + "watch": [ + "**/modules/**", + "**/antora.yml", + "**/preview.yml", + "**/publish.yml" + ], + "ext": "yml,yaml,adoc,svg,png,jpg", + "ignore": [ + "build", + "node_modules" + ] } } diff --git a/preview.yml b/preview.yml index 5040a9d04..f88c4f49b 100644 --- a/preview.yml +++ b/preview.yml @@ -24,8 +24,10 @@ urls: antora: extensions: - - require: "@neo4j-antora/antora-unlisted-pages" + - "@neo4j-antora/antora-unlisted-pages" - "@neo4j-antora/roles-labels" + - "@neo4j-antora/table-footnotes" + - "@neo4j-antora/xref-hash-validator" asciidoc: extensions: @@ -33,7 +35,6 @@ asciidoc: - "@neo4j-documentation/macros" - "@neo4j-antora/antora-add-notes" - "@neo4j-antora/antora-page-roles" - - "@neo4j-antora/antora-table-footnotes" attributes: page-theme: docs page-type: Docs diff --git a/publish.yml b/publish.yml index c05d8621c..6d7a0916c 100644 --- a/publish.yml +++ b/publish.yml @@ -25,8 +25,10 @@ urls: antora: extensions: - - require: "@neo4j-antora/antora-unlisted-pages" + - "@neo4j-antora/antora-unlisted-pages" - "@neo4j-antora/roles-labels" + - "@neo4j-antora/table-footnotes" + - "@neo4j-antora/xref-hash-validator" asciidoc: extensions: @@ -34,7 +36,6 @@ asciidoc: - "@neo4j-documentation/macros" - "@neo4j-antora/antora-add-notes" - "@neo4j-antora/antora-page-roles" - - "@neo4j-antora/antora-table-footnotes" attributes: page-theme: docs page-type: Docs