Skip to content

Commit e6137e9

Browse files
committed
feat(docs): 🚀 add workflow to deploy docs to github pages
1 parent 78b7b13 commit e6137e9

1 file changed

Lines changed: 89 additions & 0 deletions

File tree

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# -------------------------------------------------------------------------------------
2+
#
3+
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
4+
#
5+
# WSO2 LLC. licenses this file to you under the Apache License,
6+
# Version 2.0 (the "License"); you may not use this file except
7+
# in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
# --------------------------------------------------------------------------------------
20+
21+
# This workflow will publish the documentation to GitHub Pages.
22+
23+
name: ☄️ Deploy Documentation
24+
25+
on: workflow_dispatch
26+
27+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
28+
permissions:
29+
contents: read
30+
pages: write
31+
id-token: write
32+
33+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
34+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
35+
concurrency:
36+
group: "pages"
37+
cancel-in-progress: false
38+
39+
env:
40+
GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }}
41+
DOC_DIR: docs
42+
43+
jobs:
44+
deploy:
45+
environment:
46+
name: github-pages
47+
url: "web-ui-sdks"
48+
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
node-version: [lts/*]
52+
steps:
53+
- name: ⬇️ Checkout
54+
id: checkout
55+
uses: actions/checkout@v3
56+
with:
57+
fetch-depth: 0
58+
token: ${{ env.GH_TOKEN }}
59+
60+
- name: 🟢 Setup node
61+
id: setup-node
62+
uses: actions/setup-node@v2
63+
with:
64+
node-version: ${{ matrix.node-version }}
65+
66+
- name: ⚙️ Setup Pages
67+
id: setup-pages
68+
uses: actions/configure-pages@v4
69+
70+
- name: 🧩 Install Dependencies
71+
id: install-dependencies
72+
working-directory: ${{ env.DOC_DIR }}
73+
run: npm ci
74+
75+
- name: 🏗️ Build with VitePress
76+
id: build
77+
working-directory: ${{ env.DOC_DIR }}
78+
run: |
79+
npm run docs:build
80+
81+
- name: 🌩 Upload artifact
82+
id: upload-artifact
83+
uses: actions/upload-pages-artifact@v3
84+
with:
85+
path: docs/website/.vitepress/dist
86+
87+
- name: 🔥 Deploy to GitHub Pages
88+
id: deploy-gh-pages
89+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)