Skip to content

Commit 0395013

Browse files
committed
chore: fix github pages
1 parent d129f5e commit 0395013

3 files changed

Lines changed: 41 additions & 31 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,54 @@ name: Deploy
33
on:
44
push:
55
branches: [main]
6+
# Allows you to run this workflow manually from the Actions tab
7+
workflow_dispatch:
8+
9+
# Allow one concurrent deployment
10+
concurrency:
11+
group: 'pages'
12+
cancel-in-progress: true
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
619

720
jobs:
8-
# Build job
9-
build:
21+
deploy:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
1026
runs-on: ubuntu-latest
27+
defaults:
28+
run:
29+
working-directory: web-app
30+
1131
steps:
1232
- name: Checkout
1333
uses: actions/checkout@v4
14-
- name: Setup Pages
15-
id: pages
16-
uses: actions/configure-pages@v3
17-
- uses: actions/setup-node@v4
34+
- name: Get Node version
35+
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
36+
id: node-version
37+
- name: Set up Node
38+
uses: actions/setup-node@v4
1839
with:
19-
node-version: 20.x
20-
- run: npm ci
21-
working-directory: web-app
22-
- run: npx tsx generate-svg-icons-sprite.ts
23-
working-directory: web-app
24-
- run: npm run build
25-
working-directory: web-app
40+
node-version: ${{ steps.node-version.outputs.NODE_VERSION }}
41+
cache: 'npm'
42+
- name: Install dependencies
43+
run: npm ci
44+
- name: Generate SVG icons sprite
45+
run: npx tsx generate-svg-icons-sprite.ts
46+
- name: Build
47+
run: npm run build
48+
- name: Setup Pages
49+
uses: actions/configure-pages@v5
2650
- name: Upload artifact
2751
uses: actions/upload-pages-artifact@v3
2852
with:
29-
path: 'web-app/build/client'
30-
31-
# Deployment job
32-
deploy:
33-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
34-
permissions:
35-
contents: read
36-
pages: write
37-
id-token: write
38-
environment:
39-
name: github-pages
40-
url: https://heiso.github.io/macrolev
41-
runs-on: ubuntu-latest
42-
needs: build
43-
steps:
53+
path: 'build/client'
4454
- name: Deploy to GitHub Pages
4555
id: deployment
4656
uses: actions/deploy-pages@v4

web-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"version": "0.0.0",
66
"scripts": {
77
"build": "cross-env NODE_ENV=production react-router build",
8-
"preview": "react-router preview",
8+
"preview": "vite preview",
99
"dev": "react-router dev",
1010
"start": "cross-env NODE_ENV=production react-router-serve ./build/server/index.js",
11-
"typecheck": "react-router typegen && tsc && && eslint . && prettier --check .",
11+
"typecheck": "react-router typegen && tsc && eslint . && prettier --check .",
1212
"check-dependencies": "npx npm-check-updates --peer --format group -i",
1313
"down": "pm2 delete ecosystem.config.cjs",
1414
"log": "pm2 log",

web-app/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ export default defineConfig({
1414
plugins: [autoprefixer],
1515
},
1616
},
17-
plugins: [reactRouter(), tsconfigPaths(), tailwindcss()],
17+
plugins: [tailwindcss(), reactRouter(), tsconfigPaths()],
1818
})

0 commit comments

Comments
 (0)