|
1 | | -name: Build and Deploy Docs |
| 1 | +# Sample workflow for building and deploying a VitePress site to GitHub Pages |
| 2 | +# |
| 3 | +name: Deploy VitePress site to Pages |
| 4 | + |
2 | 5 | on: |
| 6 | + # Runs on pushes targeting the `main` branch. Change this to `master` if you're |
| 7 | + # using the `master` branch as the default branch. |
3 | 8 | push: |
4 | | - branches: |
5 | | - - main |
6 | | -jobs: |
7 | | - build-and-deploy: |
8 | | - name: Build and Deploy |
9 | | - runs-on: ubuntu-latest |
10 | | - env: |
11 | | - MIKE_VERSION: v4 |
12 | | - MIKE_ALIAS: stable |
13 | | - DOCKER_IMAGE: ui5-tooling/mkdocs-material |
14 | | - GIT_COMMITTER_NAME: "OpenUI5 Bot" |
15 | | - GIT_COMMITTER_EMAIL: "openui5@sap.com" |
16 | | - |
17 | | - steps: |
18 | | - - name: Checkout |
19 | | - uses: actions/checkout@v4 |
20 | | - |
21 | | - - name: Use Node.js LTS 20.x |
22 | | - uses: actions/setup-node@v4.0.3 |
23 | | - with: |
24 | | - node-version: 20.x |
| 9 | + branches: [main] |
25 | 10 |
|
26 | | - - name: Install npm dependencies |
27 | | - run: npm ci |
| 11 | + # Allows you to run this workflow manually from the Actions tab |
| 12 | + workflow_dispatch: |
28 | 13 |
|
29 | | - - name: Fetch gh-pages branch |
30 | | - run: git fetch origin gh-pages --depth=1 |
| 14 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 15 | +permissions: |
| 16 | + contents: write |
| 17 | + pages: write |
| 18 | + id-token: write |
31 | 19 |
|
32 | | - - name: Set /site ownership to current user |
33 | | - run: | |
34 | | - mkdir site |
35 | | - sudo chown -R $(id -u):$(id -g) ./site |
| 20 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 21 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 22 | +concurrency: |
| 23 | + group: pages |
| 24 | + cancel-in-progress: false |
36 | 25 |
|
37 | | - - name: Build docs with Mike |
38 | | - run: ./scripts/buildDocs.sh |
39 | | - |
40 | | - - name: Publish docs |
41 | | - 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 |
42 | | - |
43 | | - - name: Build Schema |
44 | | - run: | |
45 | | - npm run schema-generate |
46 | | - npm run schema-workspace-generate |
47 | | -
|
48 | | - - name: Checkout gh-pages |
49 | | - uses: actions/checkout@v4 |
50 | | - with: |
51 | | - ref: gh-pages |
52 | | - path: gh-pages |
53 | | - - name: Copy the additional resources to gh-pages |
54 | | - run: | |
55 | | - rm -rf ./gh-pages/schema |
56 | | - cp -R ./site/schema ./gh-pages/ |
57 | | - rm -rf ./gh-pages/$MIKE_VERSION/api |
58 | | - cp -R ./site/api ./gh-pages/$MIKE_VERSION/ |
59 | | - cp ./scripts/resources/custom404.html ./gh-pages/404.html |
60 | | - - name: Publish Docs |
61 | | - run: | |
62 | | - cd ./gh-pages |
63 | | - git config --local user.email $GIT_COMMITTER_EMAIL |
64 | | - git config --local user.name $GIT_COMMITTER_NAME |
65 | | - git add . |
66 | | - git commit -m "Updating supplemental resources for ${MIKE_VERSION} documentation deployment" |
67 | | - git push |
| 26 | +jobs: |
| 27 | + # Build job |
| 28 | + build: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + env: |
| 31 | + DOC_VERSION: v4 |
| 32 | + DOC_ALIAS: stable |
| 33 | + GIT_COMMITTER_NAME: "Konrad Kost" |
| 34 | + GIT_COMMITTER_EMAIL: "xxxx" |
| 35 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + steps: |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@v4 |
| 39 | + with: |
| 40 | + fetch-depth: 0 |
| 41 | + - name: Setup Node |
| 42 | + uses: actions/setup-node@v4 |
| 43 | + with: |
| 44 | + node-version: 20 |
| 45 | + cache: npm |
| 46 | + - name: Setup Pages |
| 47 | + uses: actions/configure-pages@v4 |
| 48 | + - name: Install dependencies |
| 49 | + run: npm ci |
| 50 | + - name: Fetch gh-pages branch |
| 51 | + run: git fetch origin gh-pages --depth=1 |
| 52 | + - name: Set /site ownership to current user |
| 53 | + run: | |
| 54 | + mkdir site |
| 55 | + sudo chown -R $(id -u):$(id -g) ./site |
| 56 | + - name: generate CLI doc |
| 57 | + run: npm run generate-cli-doc |
| 58 | + - name: Build jsdoc |
| 59 | + run: npm run jsdoc-generate |
| 60 | + - name: Build vitepress build |
| 61 | + run: npm run docs-generate |
| 62 | + - name: Build Schema |
| 63 | + run: | |
| 64 | + npm run schema-generate |
| 65 | + npm run schema-workspace-generate |
| 66 | + - name: Checkout gh-pages |
| 67 | + uses: actions/checkout@v4 |
| 68 | + with: |
| 69 | + ref: gh-pages |
| 70 | + path: gh-pages |
| 71 | + - name: Copy the additional resources to gh-pages |
| 72 | + run: | |
| 73 | + rm -rf ./gh-pages/schema |
| 74 | + cp -R ./site/schema ./gh-pages/ |
| 75 | + rm -rf ./gh-pages/$DOC_VERSION |
| 76 | + cp -R ./site ./gh-pages/$DOC_VERSION/ |
| 77 | + cp ./scripts/resources/custom404.html ./gh-pages/404.html |
| 78 | + - name: Publish Docs |
| 79 | + run: | |
| 80 | + cd ./gh-pages |
| 81 | + git config --local user.email $GIT_COMMITTER_EMAIL |
| 82 | + git config --local user.name $GIT_COMMITTER_NAME |
| 83 | + git add . |
| 84 | + git commit -m "Updating supplemental resources for ${DOC_VERSION} documentation deployment" |
| 85 | + git push |
0 commit comments