Skip to content

Commit

Permalink
ci: fix docs publishing workflow (#30)
Browse files Browse the repository at this point in the history
Adds missing `luaVersion` workflow parameter to manual-build-docs. Also
ensures `ldoc` is install on the CI runner.
  • Loading branch information
cwaldren-ld authored Dec 19, 2023
1 parent b0579a8 commit 0a112b9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ description: 'Build Documentation.'
runs:
using: composite
steps:
- name: Install LDoc
shell: bash
run: sudo apt-get update -y && sudo apt-get install -y lua-ldoc
- name: Build Documentation
shell: bash
run: ./scripts/build-docs.sh docs
run: ./scripts/build-docs.sh docs-build docs-release
2 changes: 1 addition & 1 deletion .github/actions/publish-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ runs:
- uses: launchdarkly/gh-actions/actions/[email protected]
name: 'Publish to Github pages'
with:
docs_path: docs
docs_path: docs-release
github_token: ${{ inputs.token }}
2 changes: 1 addition & 1 deletion .github/workflows/manual-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Build and Test
uses: ./.github/actions/ci
with:
token: ${{ secrets.GITHUB_TOKEN }}
lua-version: "5.3"

- name: Build documentation
uses: ./.github/actions/build-docs
Expand Down
9 changes: 6 additions & 3 deletions scripts/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
set -e

# The first argument is the directory where the docs should be built.
# The second is where the docs should be copied to when built.

if [ -z "$1" ]; then
echo "Usage: $0 <docs-build-dir>"
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <docs build dir> <docs release dir>"
exit 1
fi

DOCS_BUILD_DIR=$1
DOCS_RELEASE_DIR=$2

mkdir "$DOCS_BUILD_DIR"

cp launchdarkly-server-sdk.c "$DOCS_BUILD_DIR"
cp launchdarkly-server-sdk-redis.c "$DOCS_BUILD_DIR"

ldoc -d "$LD_RELEASE_DOCS_DIR" "$DOCS_BUILD_DIR"
ldoc -d "$DOCS_RELEASE_DIR" "$DOCS_BUILD_DIR"

0 comments on commit 0a112b9

Please sign in to comment.