Skip to content

Let docs-publish build both staging and prod, and dispatch to docs-publish #422

Let docs-publish build both staging and prod, and dispatch to docs-publish

Let docs-publish build both staging and prod, and dispatch to docs-publish #422

name: "Verify docs PR"
permissions:
contents: read
pull-requests: write
on:
pull_request:
branches:
- dev
jobs:
# Generate HTML
docs-build-pr:
uses: ./.github/workflows/reusable-docs-build.yml
with:
deploy-id: ${{ github.event.number }}
docs-dir: 'docs'
sparse-checkout: false
antora-extensions: '
../extensions/antora/aliases-redirects
../extensions/antora/antora-modify-sitemaps
../extensions/antora/antora-page-list
../extensions/antora/antora-unlisted-pages
../extensions/antora/roles-labels
../extensions/antora/selector-labels
../extensions/antora/table-footnotes
../extensions/antora/xref-hash-validator
../extensions/asciidoc/mark-terms
'
antora-ui-bundle-url: 'https://static-content.neo4j.com/build/ui-bundle-docs-restructure.zip'
# 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: ./.github/workflows/reusable-docs-verify.yml
with:
failOnWarnings: true
# Get lists of changes in the PR
# - all updated asciidoc files
# - all updated asciidoc pages
# - all new asciidoc pages
docs-changes-pr:
runs-on: ubuntu-latest
outputs:
asciidoc-files: ${{ steps.get-file-changes.outputs.asciidoc_all_changed_files }}
pages-modified: ${{ steps.get-file-changes.outputs.pages_modified_files }}
pages-added: ${{ steps.get-file-changes.outputs.pages_added_files }}
steps:
- name: Get file changes
id: get-file-changes
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47
with:
separator: ','
files_yaml: |
pages:
- modules/**/pages/**/*.adoc
asciidoc:
- modules/**/*.adoc
# Generate a PR comment if the docs are using the pageList extension
# The extension maps asciidoc source files to their HTML output paths
# The comment will contain links to new and changed pages in the deployed HTML docs
docs-updates-comment-pr:
if: needs.docs-build-pr.outputs.pages-listed == 'success'
needs: [docs-build-pr, docs-changes-pr]
uses: ./.github/workflows/reusable-docs-pr-changes.yml
with:
pages-modified: ${{ needs.docs-changes-pr.outputs.pages-modified }}
pages-added: ${{ needs.docs-changes-pr.outputs.pages-added }}