ci: Build and deploy documentation
This commit is contained in:
parent
45a1c9b711
commit
c8bf8931c8
4 changed files with 55 additions and 3 deletions
22
.ci/deploy-docs.sh
Executable file
22
.ci/deploy-docs.sh
Executable file
|
@ -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}
|
||||
|
22
.ci/deploy-docs.yml
Normal file
22
.ci/deploy-docs.yml
Normal file
|
@ -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
|
||||
|
|
@ -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))
|
||||
|
|
3
Makefile
3
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/
|
||||
|
|
Loading…
Add table
Reference in a new issue