Skip to content

Commit

Permalink
wip: moving to ci/kash [build docs]
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed May 13, 2024
1 parent de5ab85 commit f7cc28b
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build_app.yaml → .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,24 @@ jobs:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
# run: bash ./scripts/build_app.sh -p -r ${{ github.job }}
run: bash ./scripts/build_app.sh -r ${{ github.job }}

build_docs:
name: Build docs
if: ${{ contains(github.event.head_commit.message, 'build doc') }}
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: Init runner
run: bash ./scripts/init_runner.sh ${{ github.job }}
- name: Setup workspace
env:
GITHUB_DEVELOPMENT_PAT: ${{ secrets.GH_DEVELOPMENT_PAT }}
run: bash ./scripts/setup_workspace.sh -k nokli
- name: Build docs
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
# run: bash ./scripts/build_docs.sh -p -r ${{ github.job }}
run: bash ./scripts/build_docs.sh -r ${{ github.job }}
35 changes: 35 additions & 0 deletions scripts/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -euo pipefail
# set -x

THIS_FILE=$(readlink -f "${BASH_SOURCE[0]}")
THIS_DIR=$(dirname "$THIS_FILE")
ROOT_DIR=$(dirname "$THIS_DIR")
WORKSPACE_DIR="$(dirname "$ROOT_DIR")"

. "$THIS_DIR/kash/kash.sh"

## Parse options
##

PUBLISH=false
CI_STEP_NAME="Build docs"
while getopts "pr:" OPT; do
case $OPT in
p) # define to publish docs
PUBLISH=true
;;
r) # report outcome to slack
CI_STEP_NAME=$OPTARG
load_env_files "$WORKSPACE_DIR/development/common/SLACK_WEBHOOK_APPS.enc.env"
trap 'slack_ci_report "$ROOT_DIR" "$CI_STEP_NAME" "$?" "$SLACK_WEBHOOK_APPS"' EXIT
;;
*)
;;
esac
done

## Build docs
##

build_docs "$ROOT_DIR" "kalisio/kano" "$PUBLISH"
6 changes: 3 additions & 3 deletions scripts/setup_workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ begin_group "Setting up workspace ..."
if [ "$CI" = true ]; then
WORKSPACE_DIR="$(dirname "$ROOT_DIR")"

# workaround since repo is kApp with a 'A' and in kli file it's kapp with a 'a'
# mv "$WORKSPACE_DIR/kApp" "$WORKSPACE_DIR/kapp"
# ln -s "$WORKSPACE_DIR/kapp" "$WORKSPACE_DIR/kApp"
# workaround since repo is named 'kano' and in kli file it's 'maps'
mv "$WORKSPACE_DIR/kano" "$WORKSPACE_DIR/maps"
ln -s "$WORKSPACE_DIR/maps" "$WORKSPACE_DIR/kano"

DEVELOPMENT_REPO_URL="https://$GITHUB_DEVELOPMENT_PAT@github.com/kalisio/development.git"
else
Expand Down

0 comments on commit f7cc28b

Please sign in to comment.