Correct ByServers constant in NM script and remove default for logHom… #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2021, 2023, Oracle and/or its affiliates. | |
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. | |
# | |
# Description | |
# Use Hugo to build static site and publish to gh-pages | |
# | |
name: "PublishOlderMinorGitHubPages" | |
on: | |
push: | |
branches: | |
- release/4.0 | |
paths: | |
- 'documentation/**' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 32 | |
path: branch | |
- name: Checkout gh-pages | |
uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
token: ${{ secrets.PUBLISH_SECRET }} | |
- name: Build and publish site | |
run: | | |
curl -fL -o hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/v0.108.0/hugo_0.108.0_Linux-64bit.tar.gz" | |
tar -xf hugo.tar.gz | |
export PATH="$PWD:$PATH" | |
mkdir $GITHUB_WORKSPACE/WORK | |
cd $GITHUB_WORKSPACE/branch/documentation | |
echo "Documentation branch is $GITHUB_REF_NAME..." | |
minor_version=${GITHUB_REF_NAME#"release/"} | |
echo "Building documentation for older minor version..." | |
latest_tag=$(git ls-remote https://github.com/oracle/weblogic-kubernetes-operator.git --h --sort origin "refs/tags/v*" | cut -f2 | grep v$minor_version | tail -1 | cut -c12-) | |
echo "Latest tag is $latest_tag..." | |
echo $latest_tag >| $GITHUB_WORKSPACE/branch/documentation/site/layouts/shortcodes/latestVersion.html | |
hugo -s site -d "$GITHUB_WORKSPACE/WORK/$minor_version" -b https://oracle.github.io/weblogic-kubernetes-operator/$minor_version | |
cd $GITHUB_WORKSPACE/gh-pages | |
rm -Rf $minor_version | |
cp -R $GITHUB_WORKSPACE/WORK/* . | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add --all | |
git commit -m "Documentation update from publish GitHub Action" | |
git push origin gh-pages |