Skip to content

Commit 48c3147

Browse files
committed
Add GitHub docs workflow
Closes gh-5
1 parent 1fb7b7b commit 48c3147

File tree

3 files changed

+60
-4
lines changed

3 files changed

+60
-4
lines changed

.github/workflows/docs.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Grace Doc
2+
on:
3+
push:
4+
branches:
5+
- 2023.0.x
6+
paths:
7+
- 'docs/**'
8+
jobs:
9+
# Build job
10+
build:
11+
permissions:
12+
contents: read # to fetch code (actions/checkout)
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
java: ['17']
17+
steps:
18+
- name: Checkout repository
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
uses: actions/checkout@v4
22+
with:
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Setup JDK
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: 'adopt'
28+
java-version: ${{ matrix.java }}
29+
- name: Setup Gradle
30+
uses: gradle/actions/setup-gradle@v4
31+
- name: Get the current version
32+
id: getversion
33+
run: |
34+
echo "$(cat gradle.properties | grep 'projectVersion=' | awk '{print $1}')" >> "$GITHUB_OUTPUT"
35+
- name: Generate Docs
36+
id: build
37+
run: ./gradlew docs
38+
- name: Deploy to GitHub Pages
39+
id: deployment
40+
uses: rainboyan/[email protected]
41+
env:
42+
VERSION: ${{ steps.getversion.outputs.projectVersion }}
43+
TOKEN: ${{ secrets.GH_TOKEN }}
44+
BRANCH: gh-pages
45+
FOLDER: build/docs

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
build:
1212
permissions:
1313
contents: read # to fetch code (actions/checkout)
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
1717
java: ['17']
@@ -40,7 +40,7 @@ jobs:
4040
permissions:
4141
contents: read # to fetch code (actions/checkout)
4242
checks: write
43-
runs-on: ubuntu-22.04
43+
runs-on: ubuntu-latest
4444
strategy:
4545
matrix:
4646
java: ['17']

.github/workflows/release.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
create_draft_release:
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-latest
1414
env:
1515
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1616
steps:
@@ -24,7 +24,7 @@ jobs:
2424
${{ github.ref_name }}
2525
release_and_publish:
2626
needs: create_draft_release
27-
runs-on: ubuntu-22.04
27+
runs-on: ubuntu-latest
2828
strategy:
2929
matrix:
3030
java: ['17']
@@ -53,6 +53,17 @@ jobs:
5353
- name: Set the current release version
5454
id: release_version
5555
run: echo "release_version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
56+
- name: Generate Docs
57+
id: build
58+
run: ./gradlew docs
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: rainboyan/[email protected]
62+
env:
63+
VERSION: ${{ steps.release_version.outputs.release_version }}
64+
TOKEN: ${{ secrets.GH_TOKEN }}
65+
BRANCH: gh-pages
66+
FOLDER: build/docs
5667
- name: Generate secring file
5768
id: secring
5869
env:

0 commit comments

Comments
 (0)