diff --git a/.ci/deploy-docs.sh b/.ci/deploy-docs.sh new file mode 100755 index 0000000..687d2e9 --- /dev/null +++ b/.ci/deploy-docs.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +set -ex + +mkdir -p "${BUILD_DIR:-./build}" + +CMAKE_ARGS="" + +if [ -n "$CI" ]; then + CMAKE_ARGS="-DCI=ON" +fi + +sudo enable-lua ${LUA_VERSION:-5.1} + +make -j $(nproc) -C ${SOURCE_DIR:-.} BUILD_DIR=${BUILD_DIR:-./build} LUA_VERSION=${LUA_VERSION:-5.1} LUA=lua doc + +tar -czf doc.tar.gz -C ${BUILD_DIR:-./build}/doc . + +curl -T doc.tar.gz -XPOST --user ${DOCS_CREDENTIALS} https://${DOCS_HOST}/publish/lua-libpulse-glib + +sudo disable-lua ${LUA_VERSION:-5.1} + diff --git a/.ci/deploy-docs.yml b/.ci/deploy-docs.yml new file mode 100644 index 0000000..3cb49d6 --- /dev/null +++ b/.ci/deploy-docs.yml @@ -0,0 +1,22 @@ +--- +platform: linux + +image_resource: + type: registry-image + source: + repository: registry.local:5000/lua-clib-pulse + tag: latest + +inputs: +- name: repo + +params: + CI: true + SOURCE_DIR: repo + BUILD_DIR: /tmp/build-output + DOCS_HOST: ((doc-host)) + DOCS_CREDENTIALS: "((deploy-user)):((deploy-password))" + +run: + path: repo/.ci/deploy-docs.sh + diff --git a/.ci/pipeline.yml b/.ci/pipeline.yml index 10f7488..ced9a29 100644 --- a/.ci/pipeline.yml +++ b/.ci/pipeline.yml @@ -55,3 +55,14 @@ jobs: file: repo/.ci/rock.yml vars: lua-version: 5.4 + +- name: doc + plan: + - get: repo + trigger: true + - task: deploy-docs + file: repo/.ci/deploy-docs.yml + params: + doc-host: ((doc-host)) + deploy-user: ((deploy-user)) + deploy-password: ((deploy-password)) diff --git a/Makefile b/Makefile index a8899ee..d2a1cd1 100644 --- a/Makefile +++ b/Makefile @@ -82,9 +82,6 @@ doc-styles: $(BUILD_DIR)/doc/ldoc.css doc-content: $(BUILD_DIR)/doc/index.html doc: doc-styles doc-content -ifdef CI - touch "$(BUILD_DIR)/doc/.nojekyll" -endif clean: rm -r out/