Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all workflows #12

Merged
merged 6 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@dev
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@dev
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@v41
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@dev
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@dev
uses: ./.github/workflows/reusable-docs-lint.yml
with:
files: ${{ needs.docs-changes-pr.outputs.asciidoc-files }}
vale-fail-on-error: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

docs-build:
name: Generate HTML
uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@dev
uses: ./.github/workflows/reusable-docs-build.yml
with:
retain-artifacts: 14
deploy-id: 0
Expand All @@ -23,7 +23,7 @@ jobs:
docs-verify:
name: Verify HTML
needs: docs-build
uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@dev
uses: ./.github/workflows/reusable-docs-verify.yml
with:
failOnWarnings: true

Expand All @@ -33,7 +33,7 @@ jobs:

steps:
- name: Trigger Publish
uses: peter-evans/repository-dispatch@main
uses: peter-evans/repository-dispatch@bf47d102fdb849e755b0b0023ea3e81a44b6f570 # v2.1.2
with:
token: ${{ secrets.DISPATCH_TOKEN }}
repository: neo4j/docs-publish
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,39 +59,14 @@ jobs:
path: .docs-tools

- name: Use Node.js 16
uses: actions/setup-node@v3
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/[email protected]
uses: filiph/linkcheck@f2c15a0be0d9c83def5df3edcc0f2d6582845f2d # 3.0.0
with:
arguments: $DOCS_PATH/$DOCSET --skip-file $SKIPFILE -e

# - name: Run link checker
# run: |
# npx link-checker $DOCS_PATH/$DOCSET --skip-file $SKIPFILE -e |& tee link-log.txt
# warncount=$(grep -e "[0-9]* warnings" -o link-log.txt | sed 's/ warnings//' )
# if [ $warncount -gt 0 ]; then
# echo "::warning:: $warncount warnings"
# fi
# errorcount=$(grep -e "[0-9]* errors" -o link-log.txt | sed 's/ errors//' )
# if [ $errorcount -gt 0 ]; then
# echo "::error:: Errors found: See the output of the Check links step for details"
# exit 1
# fi

# upload artifacts

- name: Save log
uses: actions/upload-artifact@v3
with:
name: linklog
path: link-log.txt

# if errors, raise an issue in the repo and exit 1 to fail the workflow
# tbc...
# create an action. action needs authed token. attach log to issue. extract errors as issue text?
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
6 changes: 3 additions & 3 deletions .github/workflows/reusable-docs-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ jobs:
path: .docs-tools

- name: Download HTML
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: docs
path: build

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

Expand All @@ -79,7 +79,7 @@ jobs:
# upload artifacts

- name: Save log
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: linklog
path: link-log.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ on:
reporter:
description: 'Where action messages are reported'
type: string
default: 'github-pr-scheck'
default: 'github-pr-check'
separator:
description: 'Delimiter for input files or folders'
type: string
Expand All @@ -68,13 +68,13 @@ jobs:
steps:

# Checkout the repo
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Fetch the default vale config and styles
# Checkout to ./lint
- name: download default rules
if: ${{ inputs.use-default-rules }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: neo4j/docs-tools
ref: dev
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-docs-pr-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Get page list for PR changelog
id: get-page-list
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: page-list

Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:

- name: Upload changelog
if: ${{ hashFiles('changelog') != '' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docs
path: changelog
Loading