44# Description
55# Use Hugo to build static site and publish to gh-pages
66#
7- name : " PublishLatestMinorGitHubPages "
7+ name : " PublishOlderMinorGitHubPages "
88
99on :
1010 push :
@@ -42,23 +42,16 @@ jobs:
4242 tar -xf hugo.tar.gz
4343 export PATH="$PWD:$PATH"
4444 mkdir $GITHUB_WORKSPACE/WORK
45-
46- cp -R $GITHUB_WORKSPACE/gh-pages/charts $GITHUB_WORKSPACE/WORK
47-
4845 cd $GITHUB_WORKSPACE/branch/documentation
4946 echo "Documentation branch is $GITHUB_REF_NAME..."
50- latest_tag=$(git ls-remote https://github.com/oracle/weblogic-kubernetes-operator.git --h --sort origin "refs/tags/v*" | cut -f2 | grep v4.0 | tail -1 | cut -c12-)
51- echo "Latest tag is $latest_tag..."
52- echo $latest_tag >| $GITHUB_WORKSPACE/branch/documentation/site/layouts/shortcodes/latestVersion.html
53- echo "Building documentation for latest minor version..."
54- hugo -s site -d "$GITHUB_WORKSPACE/WORK" -b https://oracle.github.io/weblogic-kubernetes-operator
55- echo "Copying static files into place..."
56- cp -R domains "$GITHUB_WORKSPACE/WORK"
47+ minor_version=${GITHUB_REF_NAME#"release/"}
48+ echo "Building documentation for older minor version..."
49+ hugo -s site -d "$GITHUB_WORKSPACE/WORK/$minor_version" -b https://oracle.github.io/weblogic-kubernetes-operator/$minor_version
5750 cd $GITHUB_WORKSPACE/gh-pages
58- find . -maxdepth 1 -mindepth 1 -not -name '[0-9]*' -not -name '.git*' -exec rm -Rf {} \;
51+ rm -Rf $minor_version
5952 cp -R $GITHUB_WORKSPACE/WORK/* .
6053 git config --global user.name "github-actions[bot]"
6154 git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
6255 git add --all
6356 git commit -m "Documentation update from publish GitHub Action"
64- git push origin gh-pages
57+ git push origin gh-pages
0 commit comments