Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autodocs github action #12772

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 10 additions & 66 deletions .github/workflows/autodocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,73 +12,20 @@ on:
target_branch:
description: "Target Branch in kong/docs.konghq.com (e.g. release/2.4)"
required: true
force_build:
description: "Ignore the build cache and build dependencies from scratch"
type: boolean
default: false
jobs:
build:
name: Build dependencies
runs-on: ubuntu-22.04

env:
DOWNLOAD_ROOT: $HOME/download-root

steps:
- name: Set environment variables
run: |
echo "INSTALL_ROOT=$HOME/install-root" >> $GITHUB_ENV
echo "DOWNLOAD_ROOT=$HOME/download-root" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$INSTALL_ROOT/openssl/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV

- name: Checkout Kong source code
uses: actions/checkout@v4

- name: Lookup build cache
uses: actions/cache@v4
id: cache-deps
with:
path: ${{ env.INSTALL_ROOT }}
key: ${{ hashFiles('.ci/setup_env_github.sh') }}-${{ hashFiles('.requirements') }}-${{ hashFiles('kong-*.rockspec') }}
env:
BUILD_ROOT: ${{ github.workspace }}/bazel-bin/build

- name: Checkout kong-build-tools
if: steps.cache-deps.outputs.cache-hit != 'true' || github.event.inputs.force_build == 'true'
uses: actions/checkout@v4
with:
repository: Kong/kong-build-tools
path: kong-build-tools
ref: master

- name: Checkout go-pluginserver
if: steps.cache-deps.outputs.cache-hit != 'true' || github.event.inputs.force_build == 'true'
uses: actions/checkout@v4
with:
repository: Kong/go-pluginserver
path: go-pluginserver

- name: Add to Path
if: steps.cache-deps.outputs.cache-hit != 'true' || github.event.inputs.force_build == 'true'
run: echo "$INSTALL_ROOT/openssl/bin:$INSTALL_ROOT/openresty/nginx/sbin:$INSTALL_ROOT/openresty/bin:$INSTALL_ROOT/luarocks/bin:$GITHUB_WORKSPACE/kong-build-tools/openresty-build-tools" >> $GITHUB_PATH

- name: Install packages
if: steps.cache-deps.outputs.cache-hit != 'true' || github.event.inputs.force_build == 'true'
run: sudo apt update && sudo apt install libyaml-dev valgrind
jobs:
build:
uses: ./.github/workflows/build.yml
with:
relative-build-root: bazel-bin/build

- name: Build Kong dependencies
if: steps.cache-deps.outputs.cache-hit != 'true' || github.event.inputs.force_build == 'true'
run: |
source .ci/setup_env_github.sh
make dev
autodoc:
runs-on: ubuntu-22.04
needs: [build]
steps:
- name: Set environment variables
run: |
echo "INSTALL_ROOT=$HOME/install-root" >> $GITHUB_ENV
echo "DOWNLOAD_ROOT=$HOME/download-root" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$INSTALL_ROOT/openssl/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV

- name: Checkout Kong source code
uses: actions/checkout@v4
with:
Expand All @@ -97,16 +44,13 @@ jobs:
uses: actions/cache@v4
id: cache-deps
with:
path: ${{ env.INSTALL_ROOT }}
key: ${{ hashFiles('kong/.ci/setup_env_github.sh') }}-${{ hashFiles('kong/.requirements') }}-${{ hashFiles('kong/kong-*.rockspec') }}

- name: Add to Path
run: echo "$INSTALL_ROOT/openssl/bin:$INSTALL_ROOT/openresty/nginx/sbin:$INSTALL_ROOT/openresty/bin:$INSTALL_ROOT/luarocks/bin:$GITHUB_WORKSPACE/kong-build-tools/openresty-build-tools:$INSTALL_ROOT/go-pluginserver" >> $GITHUB_PATH
path: ${{ env.BUILD_ROOT }}
key: ${{ needs.build.outputs.cache-key }}

- name: Run Autodocs
run: |
cd kong
eval `luarocks path`
source ${{ env.BUILD_ROOT }}/kong-dev-venv.sh
scripts/autodoc ../docs.konghq.com ${{ github.event.inputs.version }}

- name: Generate branch name
Expand Down
Loading