Skip to content

Commit

Permalink
Add documentation to GitHub workflows (#7411)
Browse files Browse the repository at this point in the history
* Add docs.yml workflow to deploy latest docs from main branch
* Adjust heading of documentation to say 4.4
* 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 <[email protected]>
  • Loading branch information
jodygarnett and juanluisrp authored Oct 10, 2023
1 parent 5215262 commit d73e099
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 6 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:
- main
paths:
- "docs/manual/**"
pull_request:
branches:
- main
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.4 Latest" --no-redirect --update-aliases 4.4 latest
- name: deploy latest docs to gh-pages branch
if: ${{ github.event_name != 'pull_request' }}
working-directory: docs/manual
run: |
mike deploy --push --title "4.4 Latest" --no-redirect --update-aliases 4.4 latest
14 changes: 11 additions & 3 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,12 +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 @@ -62,7 +70,7 @@ jobs:
- name: Test with maven
run: |
mvn -B resources:resources@copy-index-schema-to-source -f web
mvn -B -V -fae verify -Pit
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
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.4 {#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.4 {#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 d73e099

Please sign in to comment.