Skip to content

Commit

Permalink
Enables cloud build de & en
Browse files Browse the repository at this point in the history
  • Loading branch information
saertna committed Dec 16, 2023
1 parent b1655cc commit 45b7687
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 4 deletions.
182 changes: 182 additions & 0 deletions .github/workflows/lernos-produktionskette.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
name: lernOS Produktionskette

on: push

jobs:
convert_via_pandoc:
runs-on: ubuntu-latest
steps:
# Repository auschecken, damit Workflow es nutzen kann
- uses: actions/checkout@v3


## Build german learning path
# Delete Old Versions de
- run: rm -rf ./de/${{ github.event.repository.name }}-guide.*
- run: rm -rf ./docs/de/*


# Create Chapter List de
- name: Create Chapter List de
id: chapter_list_de
run: echo "chapters=$(printf '%s ' ./de/src/[0-9]*.md)" >> "$GITHUB_OUTPUT"


# Create Microsoft Word Version (docx) de
- uses: docker://pandoc/core
with:
args: >-
./de/metadata.yaml
--standalone
--resource-path=./de/src
--number-sections
--toc
-V lang=de-de
--output=./de/${{ github.event.repository.name }}-guide-de.docx
./de/src/index.md ${{ steps.chapter_list.outputs.chapters }}
# Create HTML Version (html) de
- uses: docker://pandoc/core
with:
args: >-
./de/metadata.yaml
--standalone
--resource-path=./de/src
--number-sections
--toc
-V lang=de-de
--output=./de/${{ github.event.repository.name }}-guide-de.html
./de/src/index.md ${{ steps.chapter_list.outputs.chapters }}
# Create eBook Version (epub) de
- uses: docker://pandoc/core
with:
args: >-
./de/metadata.yaml
--standalone
--resource-path=./de/src
--number-sections
--toc
-V lang=de-de
--output=./de/${{ github.event.repository.name }}-guide-de.epub
./de/src/index.md ${{ steps.chapter_list.outputs.chapters }}
# Create PDF Version (pdf) de
- uses: docker://pandoc/extra
with:
args: >-
./de/metadata.yaml
--standalone
--resource-path=./de/src
--number-sections
--toc
-V lang=de-de
--template /.pandoc/templates/eisvogel.latex
--output=./de/${{ github.event.repository.name }}-guide-de.pdf
./de/src/index.md ${{ steps.chapter_list.outputs.chapters }}
# Create Web Version (mkdocs) de
- 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-
- run: pip install mkdocs-material
- run: mkdocs build -f ./de/mkdocs.yml


## Bulid english learning path
# Delete Old Versions en
- run: rm -rf ./en/${{ github.event.repository.name }}-guide-en.*
- run: rm -rf ./docs/en/*


# Create Chapter List en
- name: Create Chapter List en
id: chapter_list_en
run: echo "chapters=$(printf '%s ' ./en/src/[0-9]*.md)" >> "$GITHUB_OUTPUT"


# Create Microsoft Word Version (docx) en
- uses: docker://pandoc/core
with:
args: >-
./en/metadata.yaml
--standalone
--resource-path=./en/src
--number-sections
--toc
-V lang=en-en
--output=./en/${{ github.event.repository.name }}-guide-en.docx
./en/src/index.md ${{ steps.chapter_list.outputs.chapters }}
# Create HTML Version (html) en
- uses: docker://pandoc/core
with:
args: >-
./en/metadata.yaml
--standalone
--resource-path=./en/src
--number-sections
--toc
-V lang=en-en
--output=./en/${{ github.event.repository.name }}-guide-en.html
./en/src/index.md ${{ steps.chapter_list.outputs.chapters }}
# Create eBook Version (epub) en
- uses: docker://pandoc/core
with:
args: >-
./en/metadata.yaml
--standalone
--resource-path=./en/src
--number-sections
--toc
-V lang=en-en
--output=./en/${{ github.event.repository.name }}-guide-en.epub
./en/src/index.md ${{ steps.chapter_list.outputs.chapters }}
# Create PDF Version (pdf) en
- uses: docker://pandoc/extra
with:
args: >-
./en/metadata.yaml
--standalone
--resource-path=./en/src
--number-sections
--toc
-V lang=en-en
--template /.pandoc/templates/eisvogel.latex
--output=./en/${{ github.event.repository.name }}-guide-en.pdf
./en/src/index.md ${{ steps.chapter_list.outputs.chapters }}
# Create Web Version (mkdocs) en
- 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-
- run: pip install mkdocs-material
- run: mkdocs build -f ./en/mkdocs.yml


# Geänderte Datein zurück ins Repository committen
- name: Auto-commit Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Erzeugt von automatischer lernOS Produktionskette
2 changes: 1 addition & 1 deletion de/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ lof: false
toc: true
toc-own-page: true
toc-depth: 3
logo: src/images/lernOS-logo-white-4000px.png
logo: ./de/src/images/lernOS-logo-white-4000px.png
logo-width: 300px
---
1 change: 0 additions & 1 deletion de/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ nav:
- Word-Version: https://github.com/cogneon/lernos-content-curation/blob/master/de/lernOS-Content-Curation-Guide-de.docx
- HTML-Version: https://github.com/cogneon/lernos-content-curation/blob/master/de/lernOS-Content-Curation-Guide-de.html
- E-Book (epub): https://github.com/cogneon/lernos-content-curation/blob/master/de/lernOS-Content-Curation-Guide-de.epub
- E-Book (mobi): https://github.com/cogneon/lernos-content-curation/blob/master/de/lernOS-Content-Curation-Guide-de.mobi
- Links:
- lernos.org: https://lernos.org
- CONNECT Community: https://community.cogneon.de
Expand Down
2 changes: 1 addition & 1 deletion en/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ lof: false
toc: true
toc-own-page: true
toc-depth: 3
logo: src/images/lernOS-logo-white-4000px.png
logo: ./en/src/images/lernOS-logo-white-4000px.png
logo-width: 300px
---
1 change: 0 additions & 1 deletion en/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ nav:
- Word-Version: https://github.com/cogneon/lernos-template/blob/master/de/lernOS-Template-Guide-de.docx
- HTML-Version: https://github.com/cogneon/lernos-template/blob/master/de/lernOS-Template-Guide-de.html
- E-Book (epub): https://github.com/cogneon/lernos-template/blob/master/de/lernOS-Template-Guide-de.epub
- E-Book (mobi): https://github.com/cogneon/lernos-template/blob/master/de/lernOS-Template-Guide-de.mobi
- Links:
- lernos.org: https://lernos.org
- CONNECT Community: https://community.cogneon.de
Expand Down

0 comments on commit 45b7687

Please sign in to comment.