From 0a112b9fbd6a05e45bfc483f7454ff6757efc04e Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 18 Dec 2023 16:20:53 -0800 Subject: [PATCH] ci: fix docs publishing workflow (#30) Adds missing `luaVersion` workflow parameter to manual-build-docs. Also ensures `ldoc` is install on the CI runner. --- .github/actions/build-docs/action.yml | 5 ++++- .github/actions/publish-docs/action.yml | 2 +- .github/workflows/manual-publish-docs.yml | 2 +- scripts/build-docs.sh | 9 ++++++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/actions/build-docs/action.yml b/.github/actions/build-docs/action.yml index 93953bb..9b800ba 100644 --- a/.github/actions/build-docs/action.yml +++ b/.github/actions/build-docs/action.yml @@ -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 diff --git a/.github/actions/publish-docs/action.yml b/.github/actions/publish-docs/action.yml index fb5a1c4..40fded0 100644 --- a/.github/actions/publish-docs/action.yml +++ b/.github/actions/publish-docs/action.yml @@ -11,5 +11,5 @@ runs: - uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.1 name: 'Publish to Github pages' with: - docs_path: docs + docs_path: docs-release github_token: ${{ inputs.token }} diff --git a/.github/workflows/manual-publish-docs.yml b/.github/workflows/manual-publish-docs.yml index 1c3b2c9..7020ac0 100644 --- a/.github/workflows/manual-publish-docs.yml +++ b/.github/workflows/manual-publish-docs.yml @@ -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 diff --git a/scripts/build-docs.sh b/scripts/build-docs.sh index c23c119..1d99127 100755 --- a/scripts/build-docs.sh +++ b/scripts/build-docs.sh @@ -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 " +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " 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"