Skip to content

Commit

Permalink
[backport 4.2.x] Add documentation to GitHub workflows (#7415)
Browse files Browse the repository at this point in the history
Backport of  #7411.
* Add docs.yml workflow to deploy stable docs from 4.2.x branch
* Adjust heading of documentation to say 4.2
* Build the docs in PRs that modify /docs/manuals folder contents.
* Only deploy the built docs if not building a PR.

---------

Co-authored-by: Juan Luis Rodríguez <juanluisrp@gmail.com>
  • Loading branch information
jodygarnett and juanluisrp authored Oct 10, 2023
1 parent c61fde0 commit 9e4db43
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 7 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Documentation

on:
push:
branches:
- 4.2.x
paths:
- "docs/manual/**"
pull_request:
branches:
- 4.2.x
paths:
- "docs/manual/**"
workflow_dispatch:

jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout GeoNetwork
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: mkdocs install
run: pip install --upgrade pip && pip install -r docs/manual/requirements.txt
- name: git configuration
run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: build docs without publishing them
if: ${{ github.event_name == 'pull_request' }}
working-directory: docs/manual
run: |
mike deploy --title "4.2 Stable" --no-redirect --update-aliases 4.2 stable
- name: deploy 4.2 docs to gh-pages branch
if: ${{ github.event_name != 'pull_request' }}
working-directory: docs/manual
run: |
mike deploy --push --title "4.2 Stable" --no-redirect --update-aliases 4.2 stable
20 changes: 16 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Linux GitHub CI
on: [pull_request,push,workflow_dispatch]

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Xmx512m -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 -Xmx512m -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
TAKARI_SMART_BUILDER_VERSION: 0.6.1

jobs:
Expand All @@ -27,8 +27,20 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.jdk }}
cache: 'maven'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: mkdocs install
working-directory: docs/manual
run: pip install --upgrade pip && pip install -r requirements.txt
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.6.3
- name: Build with Maven
run: mvn -B -V install -DskipTests=true -Dmaven.javadoc.skip=true
run: |
mvn -B -ntp -V install -DskipTests=true -Dmaven.javadoc.skip=true -Pwith-doc
- name: Remove SNAPSHOT jars from repository
run: |
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
Expand Down Expand Up @@ -57,8 +69,8 @@ jobs:
maven-version: 3.6.3
- name: Test with maven
run: |
mvn resources:resources@copy-index-schema-to-source -f web
mvn -B -V -fae verify -Pit
mvn -B resources:resources@copy-index-schema-to-source -f web
mvn -B -ntp -V -fae verify -Pit
- name: Remove SNAPSHOT jars from repository
run: |
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ git*.properties
*/*/target/
*/target/
.*/
!.github
#GeoNetwork*
/geonetwork*
camel-harvesters/wfsfeature-harvester/logs
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/docs/index.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ hide:
- navigation
---

# GeoNetwork {#toc}
# GeoNetwork 4.2 {#toc}

Bienvenue à GeoNetwork. Cette documentation est organisée en guides spécifiques destinés à différents publics.

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ hide:
- navigation
---

# GeoNetwork {#toc}
# GeoNetwork 4.2 {#toc}

Welcome to GeoNetwork. This documentation is organized into specific guides targeting different audience.

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ markdown_extensions:

# Page tree
nav:
- index.md
- 'GeoNetwork': index.md
- 'Overview':
- overview/index.md
- overview/about.md
Expand Down

0 comments on commit 9e4db43

Please sign in to comment.