-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (66 loc) · 2.41 KB
/
nightly-docs.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
59
60
61
62
63
64
65
66
67
68
69
name: nightly-docs
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
path: geomesa.github.io
- name: Checkout GeoMesa source
uses: actions/checkout@v4
with:
repository: locationtech/geomesa
path: geomesa
- name: Check for doc updates
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd geomesa
GMDOCS="$(git log -1 --format=%at docs)"
DOCS="$(git log -1 --format=%at pom.xml)"
cd ../geomesa.github.io
DOCS="$(git log -1 --format=%at documentation/current)"
if [[ $DOCS -gt $GMDOCS ]] && [[ $DOCS -gt $GMPOM ]]; then
gh run cancel ${{ github.run_id }}
gh run watch ${{ github.run_id }}
fi
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./geomesa/docs/requirements.txt
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Build docs with Maven
run: mvn clean install -Pdocs -pl docs
working-directory: ./geomesa
- name: Copy docs
run: |
rm -r ./geomesa.github.io/documentation/current/*
cp -r ./geomesa/docs/target/html/* ./geomesa.github.io/documentation/current/
- name: Commit nightly docs
working-directory: ./geomesa.github.io
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add --all ./documentation/current/
if [[ -n $(git status --porcelain) ]]; then
git commit -am "Nightly builds for $(date '+%Y-%m-%d %H:%M')" && git push
elif [[ $(git log -1 --format=%cd --date=relative) = '8 weeks ago' ]]; then
# add a no-op commit to keep this github action from being disabled
echo "" >> ./documentation/current/index.html
git add ./documentation/current/index.html
git commit -am "Nightly builds for $(date '+%Y-%m-%d %H:%M')" && git push
fi