Skip to content

Fetch all branches to avoid detached HEAD state #40

Fetch all branches to avoid detached HEAD state

Fetch all branches to avoid detached HEAD state #40

name: lernOS Produktionskette
on:
push:
branches-ignore:
- main
jobs:
convert_via_pandoc:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- 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/*.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.docx
./de/src/index.md ${{ steps.chapter_list_de.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.html
./de/src/index.md ${{ steps.chapter_list_de.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.epub
./de/src/index.md ${{ steps.chapter_list_de.outputs.chapters }}
# Create PDF Version (pdf) de
- uses: docker://pandoc/extra:3.1
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.pdf
./de/src/index.md ${{ steps.chapter_list_de.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
# Execute Copy and Archive Script de
- name: build vault de
run: bash ./de/build_vault.sh
## Build english learning path
# Delete Old Versions en
- run: rm -rf ./en/${{ github.event.repository.name }}-guide.*
- 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/*.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.docx
./en/src/index.md ${{ steps.chapter_list_en.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.html
./en/src/index.md ${{ steps.chapter_list_en.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.epub
./en/src/index.md ${{ steps.chapter_list_en.outputs.chapters }}
# Create PDF Version (pdf) en
- uses: docker://pandoc/extra:3.1
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.pdf
./en/src/index.md ${{ steps.chapter_list_en.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
# Execute Copy and Archive Script en
- name: build vault en
run: bash ./en/build_vault.sh
# Create a draft release using the version as the name
- name: Create Draft Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.sha }}
name: "Branch Draft ${{ env.version }}"
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload Release Assets - de
## Upload Release Assets .docx - de
- name: Upload Release Assets - de (docx)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./de/${{ github.event.repository.name }}-guide.docx
asset_name: ${{ github.event.repository.name }}-guide-de.docx
asset_content_type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## Upload Release Assets .html - de
- name: Upload Release Assets - de (html)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./de/${{ github.event.repository.name }}-guide.html
asset_name: ${{ github.event.repository.name }}-guide-de.html
asset_content_type: text/html
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## Upload Release Assets .epub - de
- name: Upload Release Assets - de (epub)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./de/${{ github.event.repository.name }}-guide.epub
asset_name: ${{ github.event.repository.name }}-guide-de.epub
asset_content_type: application/epub+zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## Upload Release Assets .pdf - de
- name: Upload Release Assets - de (pdf)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./de/${{ github.event.repository.name }}-guide.pdf
asset_name: ${{ github.event.repository.name }}-guide-de.pdf
asset_content_type: application/pdf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## Upload Release Assets .zip - de
- name: Upload Release Assets - de (ZIP)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./de/${{ github.event.repository.name }}-guide-de-vault.zip
asset_name: ${{ github.event.repository.name }}-guide-de-vault.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload Release Assets - en
- name: Upload Release Assets - en (docx)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./en/${{ github.event.repository.name }}-guide.docx
asset_name: ${{ github.event.repository.name }}-guide-en.docx
asset_content_type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## Upload Release Assets .docx - en
- name: Upload Release Assets - en (html)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./en/${{ github.event.repository.name }}-guide.html
asset_name: ${{ github.event.repository.name }}-guide-en.html
asset_content_type: text/html
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## Upload Release Assets .epub - en
- name: Upload Release Assets - en (epub)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./en/${{ github.event.repository.name }}-guide.epub
asset_name: ${{ github.event.repository.name }}-guide-en.epub
asset_content_type: application/epub+zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## Upload Release Assets .pdf - en
- name: Upload Release Assets - en (pdf)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./en/${{ github.event.repository.name }}-guide.pdf
asset_name: ${{ github.event.repository.name }}-guide-en.pdf
asset_content_type: application/pdf
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## Upload Release Assets .zip - en
- name: Upload Release Assets - en (ZIP)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./en/${{ github.event.repository.name }}-guide-en-vault.zip
asset_name: ${{ github.event.repository.name }}-guide-en-vault.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}