Skip to content

Commit 31c4156

Browse files
author
Sarthak Goyal
committed
add: github workflow for deploying the website using github pages
1 parent f73e6a3 commit 31c4156

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy VitePress site to Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Enable Corepack
27+
run: corepack enable
28+
29+
- name: Setup Node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
cache: "yarn"
34+
35+
- name: Setup Pages
36+
uses: actions/configure-pages@v4
37+
38+
- name: Install dependencies
39+
run: yarn install --immutable
40+
41+
- name: Build with VitePress
42+
run: yarn docs:build
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: .vitepress/dist
48+
49+
deploy:
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
needs: build
54+
runs-on: ubuntu-latest
55+
name: Deploy
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)