-
Notifications
You must be signed in to change notification settings - Fork 7
58 lines (49 loc) · 1.6 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CD
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
build-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout Randomness source code
uses: actions/checkout@v4
with:
ref: main
path: main
- name: Checkout Randomness pages
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
# Required to push updated documentation to repository
token: ${{ secrets.personal_access_token }}
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
with:
build-root-directory: main/
add-job-summary: on-failure
- name: Extract version number
working-directory: main/
run: echo "RANDOMNESS_VERSION=v$(cat gradle.properties | grep '^version=' | sed 's/^.*=//')" >> $GITHUB_ENV
- name: Generate new documentation
working-directory: main/
run: ./gradlew dokkaHtml -Pdokka.pagesDir="${{ github.workspace }}/gh-pages/"
- name: Move new documentation into gh-pages
run: |
rm -rf gh-pages/*
mv main/build/dokka/html/* gh-pages/
- name: Push new documentation
working-directory: gh-pages/
run: |
git config --global user.name "FWDekkerBot"
git config --global user.email "[email protected]"
git add --all
git commit -m "Update for ${RANDOMNESS_VERSION}"
git push origin gh-pages