From d73e099aca4a8abbb03f363e8246a89c7a1fe9cb Mon Sep 17 00:00:00 2001 From: Jody Garnett Date: Tue, 10 Oct 2023 03:53:23 -0700 Subject: [PATCH] Add documentation to GitHub workflows (#7411) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- .github/workflows/docs.yml | 41 ++++++++++++++++++++++++++++++++++++ .github/workflows/linux.yml | 14 +++++++++--- docs/manual/docs/index.fr.md | 2 +- docs/manual/docs/index.md | 2 +- docs/manual/mkdocs.yml | 2 +- 5 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000000..3ab99b6e39d --- /dev/null +++ b/.github/workflows/docs.yml @@ -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 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 9876de1e1f8..8a94bcedc4b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -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: @@ -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 {} @@ -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 {} diff --git a/docs/manual/docs/index.fr.md b/docs/manual/docs/index.fr.md index 5b83b12bb30..a491841fe52 100644 --- a/docs/manual/docs/index.fr.md +++ b/docs/manual/docs/index.fr.md @@ -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. diff --git a/docs/manual/docs/index.md b/docs/manual/docs/index.md index 53566091e50..5780bdfdb5e 100644 --- a/docs/manual/docs/index.md +++ b/docs/manual/docs/index.md @@ -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. diff --git a/docs/manual/mkdocs.yml b/docs/manual/mkdocs.yml index 5210740fc9e..7f2219a4d5c 100644 --- a/docs/manual/mkdocs.yml +++ b/docs/manual/mkdocs.yml @@ -126,7 +126,7 @@ markdown_extensions: # Page tree nav: - - index.md + - 'GeoNetwork': index.md - 'Overview': - overview/index.md - overview/about.md