Skip to content

Commit 160c296

Browse files
committed
github workflow
Signed-off-by: rishichawda <[email protected]>
1 parent 8de19e2 commit 160c296

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- 'README.md'
9+
- '.github/workflows/deploy-docs.yml'
10+
11+
# Allow manual trigger
12+
workflow_dispatch:
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
# Allow only one concurrent deployment
21+
concurrency:
22+
group: pages
23+
cancel-in-progress: true
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: '18'
36+
cache: 'yarn'
37+
cache-dependency-path: docs/yarn.lock
38+
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v4
41+
42+
- name: Install Dependencies
43+
run: |
44+
cd docs
45+
yarn install --frozen-lockfile
46+
47+
# Import plugin into the docs to showcase examples
48+
- name: Build Plugin
49+
run: |
50+
yarn install --frozen-lockfile
51+
yarn build
52+
53+
- name: Copy Plugin to Docs
54+
run: |
55+
mkdir -p docs/node_modules/remark-notes-plugin/dist
56+
cp -r dist/* docs/node_modules/remark-notes-plugin/dist/
57+
58+
- name: Build Documentation Site
59+
run: |
60+
cd docs
61+
yarn build
62+
63+
- name: Upload artifact
64+
uses: actions/upload-pages-artifact@v3
65+
with:
66+
path: ./docs/build
67+
68+
deploy:
69+
environment:
70+
name: github-pages
71+
url: ${{ steps.deployment.outputs.page_url }}
72+
needs: build
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Deploy to GitHub Pages
76+
id: deployment
77+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)