Skip to content

Commit 6750202

Browse files
committed
GitHub workflows
1 parent 9bd188e commit 6750202

File tree

6 files changed

+49
-8
lines changed

6 files changed

+49
-8
lines changed

.github/workflows/pages.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version-file: .node-version
19+
cache: npm
20+
- name: Install
21+
run: npm install
22+
- name: Test
23+
run: npm test
24+
- name: Build
25+
run: npm run build
26+
- name: Upload
27+
uses: actions/upload-pages-artifact@v3
28+
with:
29+
path: dist
30+
deploy:
31+
needs: build
32+
permissions:
33+
id-token: write
34+
pages: write
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Deploy
41+
uses: actions/deploy-pages@v4
42+
id: deployment

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div id="root"></div>
1313
<script
1414
type="module"
15-
src="/src/main.tsx"
15+
src="./src/main.tsx"
1616
></script>
1717
</body>
1818
</html>

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"license": "MIT",
77
"scripts": {
88
"dev": "vite --port 3456",
9-
"build": "npm run lint && tsc -b && vite build",
9+
"build": "tsc -b && vite build",
1010
"lint": "eslint . && prettier --check .",
11+
"test": "npm run lint",
1112
"preview": "vite preview"
1213
},
1314
"dependencies": {

postcss.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export default {
33
tailwindcss: {},
44
autoprefixer: {},
55
},
6-
}
6+
};

tailwind.config.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
/** @type {import('tailwindcss').Config} */
22
export default {
3-
content: [
4-
"./index.html",
5-
"./src/**/*.{js,ts,jsx,tsx}",
6-
],
3+
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
74
theme: {
85
extend: {},
96
},
107
plugins: [],
11-
}
8+
};

vite.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ import svgr from "vite-plugin-svgr";
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
7+
base: "./",
78
plugins: [react(), svgr()],
89
});

0 commit comments

Comments
 (0)