Skip to content

Commit 2bd2c3a

Browse files
chore: fix documentation generation action in CI (#4683)
1 parent 4740acf commit 2bd2c3a

File tree

3 files changed

+35
-26
lines changed

3 files changed

+35
-26
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Build Documentation'
2+
description: 'Build documentation files'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Install Hugo
7+
shell: bash
8+
run: |
9+
mkdir hugo
10+
curl -L https://github.com/gohugoio/hugo/releases/download/v0.150.0/hugo_0.150.0_linux-amd64.tar.gz | tar -xzf - -C hugo
11+
echo "$(pwd)/hugo" >> $GITHUB_PATH
12+
13+
- name: Install Node and dependencies
14+
uses: mongodb-labs/drivers-github-tools/node/setup@v2
15+
16+
- name: Build Docs
17+
run: npm run build:docs -- --yes
18+
shell: bash

.github/workflows/build_and_commit_docs.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,27 @@ on:
55

66
name: Build and commit documentation
77

8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
812
jobs:
913
build-docs:
1014
# prevent subsequent commits from triggering the job multiple times
1115
concurrency:
1216
group: ci-${{ github.ref }}
1317
cancel-in-progress: true
14-
name: "Build documentation."
15-
uses: ./.github/workflows/build.yml
1618

17-
commit-docs:
18-
needs: [build-docs]
19-
permissions:
20-
contents: write
21-
pull-requests: write
22-
runs-on: ubuntu-latest
19+
runs-on: 'ubuntu-latest'
20+
2321
steps:
24-
- name: Open Pull Request
25-
uses: peter-evans/create-pull-request@v6
26-
with:
27-
title: 'docs: generate docs from latest main [skip-ci]'
28-
delete-branch: true
22+
- uses: actions/checkout@v5
23+
24+
- name: "Build documentation"
25+
uses: ./.github/actions/build_documentation
26+
27+
- name: Open Pull Request
28+
uses: peter-evans/create-pull-request@v6
29+
with:
30+
title: 'docs: generate docs from latest main [skip-ci]'
31+
delete-branch: true

.github/workflows/build_docs.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,4 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v5
18-
19-
- name: Install Hugo
20-
run: |
21-
mkdir hugo
22-
curl -L https://github.com/gohugoio/hugo/releases/download/v0.150.0/hugo_0.150.0_linux-amd64.tar.gz | tar -xzf - -C hugo
23-
echo "$(pwd)/hugo" >> $GITHUB_PATH
24-
25-
- name: Install Node and dependencies
26-
uses: mongodb-labs/drivers-github-tools/node/setup@v2
27-
28-
- name: Build Docs
29-
run: npm run build:docs -- --yes
30-
18+
- uses: ./.github/actions/build_documentation

0 commit comments

Comments
 (0)