-
Notifications
You must be signed in to change notification settings - Fork 71
67 lines (58 loc) · 1.87 KB
/
deploy-docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Build and Deploy Docs
on:
push:
branches:
- main
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
env:
MIKE_VERSION: v3
MIKE_ALIAS: next
DOCKER_IMAGE: ui5-tooling/mkdocs-material
GIT_COMMITTER_NAME: "OpenUI5 Bot"
GIT_COMMITTER_EMAIL: "[email protected]"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js LTS 18.x
uses: actions/[email protected]
with:
node-version: 18.x
- name: Install npm dependencies
run: npm ci
- 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: 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