Skip to content

Commit

Permalink
simplify docs workflow to be branch specific
Browse files Browse the repository at this point in the history
  • Loading branch information
jodygarnett committed Oct 6, 2023
1 parent 0dff946 commit c9a1fa8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 36 deletions.
47 changes: 12 additions & 35 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,29 @@ on:
push:
branches:
- main
- 4.4.x
- 4.2.x
- 3.12.x
paths:
- "docs/mannual/**/**.md"
- "docs/mannual/help.yml"
- "docs/mannual/mkdocs.yml"
- "docs/manual/**"
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout GeoNetwork
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- 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: deploy latest docs to gh-pages branch locally
working-directory: docs/manual
run: pip install --upgrade pip && pip install -r requirements.txt
- run: git config user.name 'github-actions[bot]' && git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: latest
if: ${{ github.ref_name == 'main'}}
working-directory: docs/manual
run: mike deploy --push latest --title "4.4 (Latest)"
- name: stable
if: ${{ github.ref_name == '4.2.x'}}
working-directory: docs/manual
run: mike deploy --push stable --title "4.2 (Stable)"
- name: maintenance
if: ${{ github.ref_name == '3.12.x'}}
working-directory: docs/manual
run: mike deploy --push maintenance -title "3.12 (Maintenance)"
- name: release
if: ${{ github.ref_type == 'tag'}}
run: mike deploy latest --title "4.4-latest"
- name: deploy major.minor docs to gh-pages branch, and push for publication
working-directory: docs/manual
run: |
export VERSION=`cut -d '.' -f1 -f2 <<< ${{ github.ref_name }}`
echo "deploying ${{ github.ref_name }} to docs ${VERSION}"
# mike deploy --push $VERSION
run: mike deploy --push 4.4
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

0 comments on commit c9a1fa8

Please sign in to comment.