Skip to content

Commit d7bc4ef

Browse files
committed
ci: consolidate docs deployment workflows and add PR previews
Signed-off-by: Aritra Dey <[email protected]>
1 parent e280082 commit d7bc4ef

File tree

3 files changed

+51
-37
lines changed

3 files changed

+51
-37
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/publish-docs.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Publish Docs
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
types: [opened, synchronize, reopened, closed]
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
statuses: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build-and-deploy:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout 🛎️
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '20'
31+
32+
- name: Install and Build 🔧
33+
run: |
34+
npm ci
35+
npm run build
36+
37+
- name: Deploy Preview deploy-preview 🚀
38+
if: github.event_name == 'pull_request'
39+
uses: rossjrw/pr-preview-action@v1
40+
with:
41+
source-dir: ./docusaurus/
42+
preview-branch: gh-pages-pr-previews
43+
umbrella-dir: pr-preview
44+
action: auto
45+
46+
- name: Deploy to GitHub Pages 🚀
47+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
48+
uses: JamesIves/github-pages-deploy-action@v4
49+
with:
50+
branch: gh-pages
51+
folder: build

0 commit comments

Comments
 (0)