Skip to content

Commit 6274638

Browse files
committed
add ci to deploy website
1 parent 6bdbbf6 commit 6274638

File tree

5 files changed

+77
-1
lines changed

5 files changed

+77
-1
lines changed

.github/workflows/website.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
# Trigger the workflow every time you push to the `main` branch
5+
# Using a different branch name? Replace `main` with your branch’s name
6+
push:
7+
branches: [main]
8+
# Allows you to run this workflow manually from the Actions tab on GitHub.
9+
workflow_dispatch:
10+
11+
# Allow this job to clone the repo and create a page deployment
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout your repository using git
22+
uses: actions/checkout@v3
23+
24+
- name: Setup PNPM
25+
uses: pnpm/action-setup@v2
26+
with:
27+
version: 8.x.x
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: 20.x
33+
cache: pnpm
34+
cache-dependency-path: pnpm-lock.yaml
35+
36+
- name: Install
37+
run: |
38+
pnpm install
39+
pnpm build
40+
41+
- name: Build
42+
run: |
43+
cd website
44+
pnpm run build
45+
46+
- name: Upload Page Artifact
47+
uses: actions/upload-pages-artifact@v1
48+
with:
49+
path: 'website/dist/'
50+
51+
deploy:
52+
needs: build
53+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
54+
permissions:
55+
pages: write # to deploy to Pages
56+
id-token: write # to verify the deployment originates from an appropriate source
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v2

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@
3636
"lint-staged": {
3737
"*.{js,jsx,ts,tsx}": "eslint --cache --fix",
3838
"*.{js,jsx,ts,tsx,md,html,css,json}": "prettier --write"
39-
}
39+
},
40+
"packageManager": "pnpm@8"
4041
}

website/astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import tailwind from '@astrojs/tailwind'
66

77
// https://astro.build/config
88
export default defineConfig({
9+
site: 'https://orga.js.org',
910
integrations: [
1011
react(),
1112
orga({

website/public/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
orga.js.org
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
import Playground from './playground.tsx'
3+
import Editor from './editor.tsx'
4+
const {content} = Astro.props.metadata || Astro.props;
5+
---
6+
7+
<div class='h-[350px] not-prose'>
8+
<Editor className='h-full w-full' client:load content={content} />
9+
</div>

0 commit comments

Comments
 (0)