Skip to content

Commit d388d9c

Browse files
committed
Prepare to make 4.1 the latest version
1 parent abed5e5 commit d388d9c

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright (c) 2021, 2023, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
#
4+
# Description
5+
# Use Hugo to build static site and publish to gh-pages
6+
#
7+
name: "PublishLatestMinorGitHubPages"
8+
9+
on:
10+
push:
11+
branches:
12+
- release/4.1
13+
paths:
14+
- 'documentation/**'
15+
16+
defaults:
17+
run:
18+
shell: bash
19+
20+
jobs:
21+
publish:
22+
name: Publish
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout branch
27+
uses: actions/checkout@v3
28+
with:
29+
fetch-depth: 32
30+
path: branch
31+
32+
- name: Checkout gh-pages
33+
uses: actions/checkout@v3
34+
with:
35+
ref: gh-pages
36+
path: gh-pages
37+
token: ${{ secrets.PUBLISH_SECRET }}
38+
39+
- name: Build and publish site
40+
run: |
41+
curl -fL -o hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/v0.108.0/hugo_0.108.0_Linux-64bit.tar.gz"
42+
tar -xf hugo.tar.gz
43+
export PATH="$PWD:$PATH"
44+
mkdir $GITHUB_WORKSPACE/WORK
45+
46+
cp -R $GITHUB_WORKSPACE/gh-pages/charts $GITHUB_WORKSPACE/WORK
47+
48+
cd $GITHUB_WORKSPACE/branch/documentation
49+
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.1 | 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"
57+
cd $GITHUB_WORKSPACE/gh-pages
58+
find . -maxdepth 1 -mindepth 1 -not -name '[0-9]*' -not -name '.git*' -exec rm -Rf {} \;
59+
cp -R $GITHUB_WORKSPACE/WORK/* .
60+
git config --global user.name "github-actions[bot]"
61+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
62+
git add --all
63+
git commit -m "Documentation update from publish GitHub Action"
64+
git push origin gh-pages

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
run: |
1818
VERSION=${GITHUB_REF_NAME#v}
1919
echo "VERSION=$VERSION" >> $GITHUB_ENV
20-
echo "IMAGE_NAME=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:$VERSION" >> $GITHUB_ENV
20+
echo "IMAGE_NAME=${{ env.BASE_IMAGE_NAME }}:$VERSION" >> $GITHUB_ENV
2121
2222
- name: Checkout branch
2323
uses: actions/checkout@v3

0 commit comments

Comments
 (0)