Skip to content

Commit 703f84c

Browse files
committed
Update GitHub actions for 4.2
1 parent 761df88 commit 703f84c

File tree

4 files changed

+65
-115
lines changed

4 files changed

+65
-115
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/publish-gh-pages.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright (c) 2021, 2024, 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.2
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@v4
28+
with:
29+
fetch-depth: 32
30+
path: branch
31+
32+
- name: Checkout gh-pages
33+
uses: actions/checkout@v4
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.2 | 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
@@ -47,7 +47,7 @@ jobs:
4747
gh release create ${{ github.ref_name }} \
4848
--draft \
4949
--generate-notes \
50-
--target release/4.1 \
50+
--target release/4.2 \
5151
--title 'Operator ${{ env.VERSION }}' \
5252
--repo https://github.com/oracle/weblogic-kubernetes-operator \
5353
domain-upgrader/target/domain-upgrader.jar

0 commit comments

Comments
 (0)