Skip to content

Commit

Permalink
[FEATURE] Migrate UI5 Tooling documentation to VitePress
Browse files Browse the repository at this point in the history
  • Loading branch information
konnraad authored and flovogt committed Aug 29, 2024
1 parent d8a47a8 commit 6409625
Show file tree
Hide file tree
Showing 122 changed files with 43,294 additions and 3,001 deletions.
142 changes: 81 additions & 61 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,87 @@
name: Build and Deploy Docs
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy VitePress site to Pages

on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're

Check warning on line 6 in .github/workflows/deploy-docs.yml

View check run for this annotation

In Solidarity / Inclusive Language

Match Found

You might want to consider an alternative to the term "master". Possibilities might include: "active", "central", "initiator", "leader", "main", "orchestrator", "parent", "primary", "server". (This check uses pattern-matching and may therefore be incorrect. To improve the patterns or to make other suggestions, please open an issue or pull-request at https://github.com/ietf/terminology/issues.)
Raw output
/\bmaster\w*\b/gi
# using the `master` branch as the default branch.

Check warning on line 7 in .github/workflows/deploy-docs.yml

View check run for this annotation

In Solidarity / Inclusive Language

Match Found

You might want to consider an alternative to the term "master". Possibilities might include: "active", "central", "initiator", "leader", "main", "orchestrator", "parent", "primary", "server". (This check uses pattern-matching and may therefore be incorrect. To improve the patterns or to make other suggestions, please open an issue or pull-request at https://github.com/ietf/terminology/issues.)
Raw output
/\bmaster\w*\b/gi
push:
branches:
- main
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
env:
MIKE_VERSION: v4
MIKE_ALIAS: stable
DOCKER_IMAGE: ui5-tooling/mkdocs-material
GIT_COMMITTER_NAME: "OpenUI5 Bot"
GIT_COMMITTER_EMAIL: "openui5@sap.com"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js LTS 20.x
uses: actions/setup-node@v4.0.3
with:
node-version: 20.x
branches: [main]

- name: Install npm dependencies
run: npm ci
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

- name: Fetch gh-pages branch
run: git fetch origin gh-pages --depth=1
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write

- name: Set /site ownership to current user
run: |
mkdir site
sudo chown -R $(id -u):$(id -g) ./site
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

- name: Build docs with Mike
run: ./scripts/buildDocs.sh

- name: Publish docs
run: docker run --rm -v $(pwd):/docs --entrypoint mike --env GIT_COMMITTER_NAME="${GIT_COMMITTER_NAME}" --env GIT_COMMITTER_EMAIL="${GIT_COMMITTER_EMAIL}" $DOCKER_IMAGE set-default stable --push

- name: Build Schema
run: |
npm run schema-generate
npm run schema-workspace-generate
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Copy the additional resources to gh-pages
run: |
rm -rf ./gh-pages/schema
cp -R ./site/schema ./gh-pages/
rm -rf ./gh-pages/$MIKE_VERSION/api
cp -R ./site/api ./gh-pages/$MIKE_VERSION/
cp ./scripts/resources/custom404.html ./gh-pages/404.html
- name: Publish Docs
run: |
cd ./gh-pages
git config --local user.email $GIT_COMMITTER_EMAIL
git config --local user.name $GIT_COMMITTER_NAME
git add .
git commit -m "Updating supplemental resources for ${MIKE_VERSION} documentation deployment"
git push
jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
DOC_VERSION: v4
DOC_ALIAS: stable
GIT_COMMITTER_NAME: "Konrad Kost"
GIT_COMMITTER_EMAIL: "xxxx"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm i # or pnpm install / yarn install / bun install
- name: Fetch gh-pages branch
run: git fetch origin gh-pages --depth=1
- name: Set /site ownership to current user
run: |
mkdir site
sudo chown -R $(id -u):$(id -g) ./site
- name: generate CLI doc
run: npm run generate-cli-doc # or pnpm install / yarn install / bun install
- name: Build jsdoc
run: npm run jsdoc-generate
- name: Build vitepress build
run: npm run docs:build
- name: Build Schema
run: |
npm run schema-generate
npm run schema-workspace-generate
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Copy the additional resources to gh-pages
run: |
rm -rf ./gh-pages/schema
cp -R ./site/schema ./gh-pages/
rm -rf ./gh-pages/$DOC_VERSION
cp -R ./site ./gh-pages/$DOC_VERSION/
cp ./scripts/resources/custom404.html ./gh-pages/404.html
- name: Publish Docs
run: |
cd ./gh-pages
git config --local user.email $GIT_COMMITTER_EMAIL
git config --local user.name $GIT_COMMITTER_NAME
git add .
git commit -m "Updating supplemental resources for ${DOC_VERSION} documentation deployment"
git push
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ site/

# Custom files
docs/pages/CLI.md
docs/CLI.md

52 changes: 52 additions & 0 deletions .vitepress/cache/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"hash": "b6be9fd8",
"configHash": "f384ce4c",
"lockfileHash": "23ddd169",
"browserHash": "a06b72e2",
"optimized": {
"vue": {
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "ceacbf15",
"needsInterop": false
},
"vitepress > @vue/devtools-api": {
"src": "../../../node_modules/@vue/devtools-api/dist/index.js",
"file": "vitepress___@vue_devtools-api.js",
"fileHash": "eafcbfdc",
"needsInterop": false
},
"vitepress > @vueuse/core": {
"src": "../../../node_modules/@vueuse/core/index.mjs",
"file": "vitepress___@vueuse_core.js",
"fileHash": "b61e56d9",
"needsInterop": false
},
"vitepress > @vueuse/integrations/useFocusTrap": {
"src": "../../../node_modules/@vueuse/integrations/useFocusTrap.mjs",
"file": "vitepress___@vueuse_integrations_useFocusTrap.js",
"fileHash": "1482b0ac",
"needsInterop": false
},
"vitepress > mark.js/src/vanilla.js": {
"src": "../../../node_modules/mark.js/src/vanilla.js",
"file": "vitepress___mark__js_src_vanilla__js.js",
"fileHash": "b7b81973",
"needsInterop": false
},
"vitepress > minisearch": {
"src": "../../../node_modules/minisearch/dist/es/index.js",
"file": "vitepress___minisearch.js",
"fileHash": "fd23aab4",
"needsInterop": false
}
},
"chunks": {
"chunk-YVCV7MZG": {
"file": "chunk-YVCV7MZG.js"
},
"chunk-45KCXATN": {
"file": "chunk-45KCXATN.js"
}
}
}
Loading

0 comments on commit 6409625

Please sign in to comment.