Skip to content

Create Markdown

Create Markdown #82

name: Create Markdown
on:
workflow_dispatch:
push:
paths:
- 'docs/service/*.json'
pull_request:
branches:
- main
paths:
- 'docs/service/*.json'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
create-markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Install groovy
run: sudo apt install groovy
- name: Generate sitemap.xml
run: groovy createSitemap.groovy > docs/sitemap.xml
- name: Generate catalog
run: cd docs ; groovy createCatalog.groovy > catalog.md ; groovy createIndex.groovy > index.md
- name: Generate service pages
run: cd docs/service ; groovy createMarkdown.groovy *.json
- name: Commit report
run: |
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git add docs/sitemap.xml
git add docs/index.md
git add docs/catalog.md
git add docs/service/*.md
if git diff --exit-code --staged; then
echo "No changes"
else
git commit -m 'Updated service Markdown '
git push
fi
# Build Jeckyll Website job
build:
runs-on: ubuntu-latest
needs: create-markdown
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./docs
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
# Jeckyll Website Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4