Skip to content

Commit d13e734

Browse files
authored
chore: 👷 add GitHub Pages workflow (#52)
1 parent 8e9336a commit d13e734

File tree

3 files changed

+62
-1
lines changed

3 files changed

+62
-1
lines changed

.github/workflows/page.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy static content to Pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
workflow_dispatch:
8+
9+
env:
10+
pnpm-version: 7.x.x
11+
node-version: 16.x
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
deploy:
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deployment.outputs.page_url }}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
32+
- name: Set up environment
33+
uses: ./.github/actions/setup
34+
with:
35+
pnpm-version: ${{ env.pnpm-version }}
36+
node-version: ${{ env.node-version }}
37+
38+
- name: Build e2e page
39+
run: pnpm run dev:e2e-build
40+
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v3
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v1
46+
with:
47+
path: "./test/e2e/dist"
48+
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v1

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"typecheck": "tsc",
3232
"format": "prettier --write --ignore-unknown src/*",
3333
"dev:test": "vitest",
34-
"dev:e2e": "pnpm run build && vite serve test/e2e/"
34+
"dev:e2e": "pnpm run build && vite --config test/e2e/vite.config.e2e.ts",
35+
"dev:e2e-build": "pnpm run build && vite build --config test/e2e/vite.config.e2e.ts"
3536
},
3637
"devDependencies": {
3738
"@types/lodash.merge": "^4.6.7",

test/e2e/vite.config.e2e.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference types="vitest" />
2+
/// <reference types="vite/client" />
3+
// import { resolve } from "path"
4+
import { defineConfig } from "vitest/config"
5+
6+
export default defineConfig({
7+
root: "test/e2e/",
8+
base: "/tailwindcss-claymorphism/",
9+
})

0 commit comments

Comments
 (0)