Skip to content

Commit 2e7ad41

Browse files
authored
Use latest workflows (#389)
1 parent 4aa5f6d commit 2e7ad41

File tree

4 files changed

+44
-19
lines changed

4 files changed

+44
-19
lines changed

.github/workflows/CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/docs-deploy-surge.yml

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
# This workflow expects the triggering workflow to generate an artifact called "docs"
77
# - update the reference to "docs" and "docs.zip" in this workflow if your triggering workflow generates an artifact with a different name
88

9+
# change to force workflow with no changelog
10+
911
name: "Deploy docs preview"
1012

1113
on:
1214
workflow_run:
13-
workflows: ["Verify Docs PR"]
15+
workflows: ["Verify docs PR"]
1416
types:
1517
- completed
1618

@@ -23,7 +25,7 @@ jobs:
2325

2426
steps:
2527
- name: "Download built documentation"
26-
uses: actions/github-script@v6.4.1
28+
uses: actions/github-script@v7
2729
env:
2830
RUN_ID: ${{ github.event.workflow_run.id }}
2931
WORKSPACE: ${{ github.workspace }}
@@ -34,19 +36,41 @@ jobs:
3436
repo: context.repo.repo,
3537
run_id: ${{ env.RUN_ID }},
3638
});
37-
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
39+
40+
var matchArtifactDocs = artifacts.data.artifacts.filter((artifact) => {
3841
return artifact.name == "docs"
3942
})[0];
40-
var download = await github.rest.actions.downloadArtifact({
43+
var downloadDocs = await github.rest.actions.downloadArtifact({
4144
owner: context.repo.owner,
4245
repo: context.repo.repo,
43-
artifact_id: matchArtifact.id,
46+
artifact_id: matchArtifactDocs.id,
4447
archive_format: 'zip',
4548
});
4649
var fs = require('fs');
47-
fs.writeFileSync('${{ env.WORKSPACE }}/docs.zip', Buffer.from(download.data));
48-
49-
- run: unzip docs.zip
50+
fs.writeFileSync('${{ env.WORKSPACE }}/docs.zip', Buffer.from(downloadDocs.data));
51+
52+
var matchArtifactChangelog = artifacts.data.artifacts.filter((artifact) => {
53+
return artifact.name == "changelog"
54+
})[0];
55+
var downloadChangelog = await github.rest.actions.downloadArtifact({
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
artifact_id: matchArtifactChangelog.id,
59+
archive_format: 'zip',
60+
});
61+
fs.writeFileSync('${{ env.WORKSPACE }}/changelog.zip', Buffer.from(downloadChangelog.data));
62+
63+
- id: unzip-docs
64+
run: unzip docs.zip
65+
66+
- id: get-top-dir
67+
run: |
68+
root=$(ls -d */index.html | sed -r 's/(.*)\/index\.html/\1/')
69+
echo "top-dir=$root" >> $GITHUB_OUTPUT
70+
71+
- id: unzip-changelog
72+
if: ${{ hashFiles('changelog.zip') != '' }}
73+
run: unzip changelog.zip
5074

5175
- id: get-deploy-id
5276
run: |
@@ -63,7 +87,7 @@ jobs:
6387
deployurl=$ORG-$REPO-$DEPLOYID.surge.sh
6488
echo "deploy-url=$deployurl" >> $GITHUB_OUTPUT
6589
66-
- uses: actions/setup-node@v3
90+
- uses: actions/setup-node@v4
6791
with:
6892
node-version: lts/*
6993

@@ -72,15 +96,16 @@ jobs:
7296
env:
7397
DEPLOY_URL: ${{ steps.get-deploy-url.outputs.deploy-url }}
7498
SURGE_TOKEN: "${{ secrets.DOCS_SURGE_TOKEN }}"
99+
SITE_DIR: ${{ steps.get-top-dir.outputs.top-dir }}
75100
run: |
76101
npm install -g surge
77-
surge ./site $DEPLOY_URL --token "$SURGE_TOKEN"
102+
surge ./$SITE_DIR $DEPLOY_URL --token "$SURGE_TOKEN"
78103
79104
# If the PR artifacts include a changelog file, add it to the PR as a comment
80105
# The changelog contains links to new and changed files in the deployed docs
81106
- name: Comment on PR (changelog)
82107
if: ${{ hashFiles('changelog') != '' }}
83-
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd #v2.8.0
108+
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 #v2.9.0
84109
with:
85110
number: ${{ steps.get-deploy-id.outputs.deploy-id }}
86111
recreate: true
@@ -93,7 +118,7 @@ jobs:
93118
if: ${{ hashFiles('changelog') == '' }}
94119
env:
95120
DEPLOY_URL: ${{ steps.get-deploy-url.outputs.deploy-url }}
96-
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd #v2.8.0
121+
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 #v2.9.0
97122
with:
98123
number: ${{ steps.get-deploy-id.outputs.deploy-id }}
99124
header: docs-pr-changes

.github/workflows/docs-pr-checks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
name: "Verify Docs PR"
2+
name: "Verify docs PR"
33

44
on:
55
pull_request:
@@ -11,7 +11,7 @@ jobs:
1111

1212
# Generate HTML
1313
docs-build-pr:
14-
uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v1.0.3
14+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-build.yml@v1.1.2
1515
with:
1616
deploy-id: ${{ github.event.number }}
1717
retain-artifacts: 14
@@ -21,7 +21,7 @@ jobs:
2121
# By default, the job fails if there are errors, passes if there are warnings only.
2222
docs-verify-pr:
2323
needs: docs-build-pr
24-
uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v1.0.3
24+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-verify.yml@v1.1.2
2525
with:
2626
failOnWarnings: true
2727

@@ -53,7 +53,7 @@ jobs:
5353
docs-updates-comment-pr:
5454
if: needs.docs-build-pr.outputs.pages-listed == 'success'
5555
needs: [docs-build-pr, docs-changes-pr]
56-
uses: neo4j/docs-tools/.github/workflows/reusable-docs-pr-changes.yml@v1.0.3
56+
uses: neo4j/docs-tools/.github/workflows/reusable-docs-pr-changes.yml@v1.1.2
5757
with:
5858
pages-modified: ${{ needs.docs-changes-pr.outputs.pages-modified }}
5959
pages-added: ${{ needs.docs-changes-pr.outputs.pages-added }}

.github/workflows/docs-teardown.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/setup-node@v3
17+
- uses: actions/setup-node@v4
1818
with:
1919
node-version: lts/*
2020

@@ -37,7 +37,7 @@ jobs:
3737
surge teardown $DEPLOY_URL --token "$SURGE_TOKEN"
3838
3939
- name: Comment on PR
40-
uses: marocchino/sticky-pull-request-comment@efaaab3fd41a9c3de579aba759d2552635e590fd # v2.8.0
40+
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 #v2.9.0
4141
with:
4242
number: ${{ github.event.pull_request.number }}
4343
header: docs-pr-changes
@@ -46,3 +46,4 @@ jobs:
4646
4747
The preview documentation has now been torn down - reopening this PR will republish it.
4848
GITHUB_TOKEN: ${{ secrets.DOCS_PR_COMMENT_TOKEN }}
49+

0 commit comments

Comments
 (0)