Skip to content

Commit

Permalink
Update all workflows (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
recrwplay committed Jan 18, 2024
1 parent 2600910 commit 9d04982
Show file tree
Hide file tree
Showing 14 changed files with 439 additions and 73 deletions.
54 changes: 0 additions & 54 deletions .github/workflows/docs-branch-checks.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/docs-deploy-surge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
deployurl=$ORG-$REPO-$DEPLOYID.surge.sh
echo "deploy-url=$deployurl" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: lts/*

Expand All @@ -80,7 +80,7 @@ jobs:
# The changelog contains links to new and changed files in the deployed docs
- name: Comment on PR (changelog)
if: ${{ hashFiles('changelog') != '' }}
uses: marocchino/sticky-pull-request-comment@v2
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd #v2.8.0
with:
number: ${{ steps.get-deploy-id.outputs.deploy-id }}
recreate: true
Expand All @@ -93,7 +93,7 @@ jobs:
if: ${{ hashFiles('changelog') == '' }}
env:
DEPLOY_URL: ${{ steps.get-deploy-url.outputs.deploy-url }}
uses: marocchino/sticky-pull-request-comment@v2
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd #v2.8.0
with:
number: ${{ steps.get-deploy-id.outputs.deploy-id }}
header: docs-pr-changes
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/docs-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is an example of the docs-pr.yml workflow available from the recrwplay org
name: "Check Docs Links"

on:
push:
branches:
- dev
workflow_dispatch:
# schedule:
# - cron: '00 16 * * *'


jobs:

docs-build:
name: Generate HTML
uses: ./.github/workflows/reusable-docs-build.yml
with:
retain-artifacts: 14
deploy-id: 0

docs-links:
name: Check links
needs: docs-build
uses: ./.github/workflows/reusable-docs-links.yml
16 changes: 16 additions & 0 deletions .github/workflows/docs-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Use vale to lint asciidoc
name: "Check Docs style"

on:
push:
branches:
- dev
workflow_dispatch:
# schedule:
# - cron: '00 16 * * *'

jobs:

docs-lint:
name: Lint docs
uses: ./.github/workflows/reusable-docs-lint.yml
10 changes: 5 additions & 5 deletions .github/workflows/docs-pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

# Generate HTML
docs-build-pr:
uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@main
uses: ./.github/workflows/reusable-docs-build.yml
with:
deploy-id: ${{ github.event.number }}
retain-artifacts: 14
Expand All @@ -21,7 +21,7 @@ jobs:
# 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@main
uses: ./.github/workflows/reusable-docs-verify.yml
with:
failOnWarnings: true

Expand All @@ -38,7 +38,7 @@ jobs:
steps:
- name: Get file changes
id: get-file-changes
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@cbda684547adc8c052d50711417fa61b428a9f88 # v41.1.2
with:
separator: ','
files_yaml: |
Expand All @@ -53,7 +53,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@main
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 }}
Expand All @@ -63,7 +63,7 @@ jobs:
docs-lint-pr:
needs: docs-changes-pr
if: needs.docs-changes-pr.outputs.asciidoc-files != ''
uses: neo4j/docs-tools/.github/workflows/reusable-docs-vale.yml@main
uses: ./.github/workflows/reusable-docs-lint.yml
with:
files: ${{ needs.docs-changes-pr.outputs.asciidoc-files }}
vale-fail-on-error: true
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

name: "Publish Branch"

on:
push:
branches:
- 'dev'
workflow_dispatch:
# schedule:
# - cron: '00 16 * * *'

jobs:

docs-build:
name: Generate HTML
uses: ./.github/workflows/reusable-docs-build.yml
with:
retain-artifacts: 14
deploy-id: 0
package-script: 'publish-verify'
cli-options: '--extension ./.docs-tools/extensions/antora/aliases-redirects'

docs-verify:
name: Verify HTML
needs: docs-build
uses: ./.github/workflows/reusable-docs-verify.yml
with:
failOnWarnings: true

trigger-publish:
needs: docs-verify
runs-on: ubuntu-latest

steps:
- name: Trigger Publish
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2.1.2
with:
token: ${{ secrets.DISPATCH_TOKEN }}
repository: neo4j/docs-publish
event-type: docs-tools
client-payload: |-
{
"org": "${{ github.repository_owner }}",
"repo": "${{ github.event.repository.name }}",
"run_id": "${{ github.run_id }}",
"branch": "${{ github.ref_name }}",
"publish_env": "dev",
"docsets": [
"docs-tools"
]
}
72 changes: 72 additions & 0 deletions .github/workflows/docs-published-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Check links on neo4j.com

on:
workflow_call:
inputs:
docs-path:
description: 'The path to the docs to check'
type: string
default: 'https://neo4j.com/docs'
docset:
description: 'The doc set to check'
type: string
default: 'operations-manual'
skipfile:
description: 'The path to the skipfile'
type: string
default: '.docs-tools/link-checker/ignore-links.txt'
retain-artifacts:
description: 'The number of days to retain artifacts'
type: number
default: 7
workflow_dispatch:
inputs:
docs-path:
description: 'The path to the docs to check'
type: string
default: 'https://neo4j.com/docs'
docset:
description: 'The doc set to check'
type: string
default: 'operations-manual'
skipfile:
description: 'The path to the skipfile'
type: string
default: '.docs-tools/link-checker/ignore-links.txt'
retain-artifacts:
description: 'The number of days to retain artifacts'
type: number
default: 7

jobs:
check-links:
runs-on: ubuntu-latest

env:
DOCS_PATH: ${{ inputs.docs-path }}
DOCSET: ${{ inputs.docset }}
SKIPFILE: ${{ inputs.skipfile }}

steps:

- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: neo4j/docs-tools
ref: dev
sparse-checkout: |
link-checker
path: .docs-tools

- name: Use Node.js 16
uses: actions/setup-node@v4
with:
node-version: '16'

# - name: Install link checker
# run: npm install github:recrwplay/link-checker#v0.2.0

- name: Run link checker
uses: filiph/linkcheck@f2c15a0be0d9c83def5df3edcc0f2d6582845f2d # 3.0.0
with:
arguments: $DOCS_PATH/$DOCSET --skip-file $SKIPFILE -e
4 changes: 2 additions & 2 deletions .github/workflows/docs-teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: lts/*

Expand All @@ -36,7 +36,7 @@ jobs:
surge teardown $DEPLOY_URL --token "$SURGE_TOKEN"
- name: Comment on PR
uses: marocchino/sticky-pull-request-comment@v2
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd #v2.8.0
with:
number: ${{ github.event.pull_request.number }}
header: docs-pr-changes
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/reusable-docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
CLI_OPTIONS: ${{ inputs.cli-options }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Checkout tools repo
uses: actions/checkout@v4
Expand All @@ -82,7 +82,7 @@ jobs:
path: .docs-tools

- name: Use Node.js 16
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'

Expand All @@ -96,14 +96,14 @@ jobs:
run: echo $DEPLOY_ID > ./build/deployid

- name: Upload HTML artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docs
path: build/
retention-days: ${{ inputs.retain-artifacts }}

- name: Upload Log artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: antora-log
path: build/log
Expand All @@ -112,7 +112,7 @@ jobs:
- name: Upload Page List artifact
id: page-list-artifact
if: ${{ inputs.pageList }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: page-list
path: build/site/.meta/pageList
Expand Down
Loading

0 comments on commit 9d04982

Please sign in to comment.