Skip to content

Commit fdb204b

Browse files
committed
Add gh-pages workflow
1 parent dffc45c commit fdb204b

5 files changed

Lines changed: 577 additions & 103 deletions

File tree

.github/workflows/cd.yml

Lines changed: 0 additions & 92 deletions
This file was deleted.

.github/workflows/gh.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CD Pipeline GH Pages
2+
on:
3+
push:
4+
branches: ["staging", "main"]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
name: Build sites
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Create NodeJS env
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 22.x
17+
18+
- name: Install packages
19+
run: npm ci && npm ci --prefix frontend && npm ci --prefix backend
20+
21+
- name: Build frontend
22+
run: npm run build --prefix frontend
23+
24+
- name: Configure GH Pages
25+
uses: actions/configure-pages@v5
26+
27+
- name: Create & upload artifacts
28+
uses: actions/upload-pages-artifact@v3
29+
with:
30+
name: "GH-pages"
31+
path: frontend/dist
32+
deploy:
33+
runs-on: ubuntu-latest
34+
needs: build
35+
permissions:
36+
contents: read
37+
pages: write
38+
id-token: write
39+
steps:
40+
- name: GH Page deploy
41+
uses: actions/deploy-pages@v4
42+
with:
43+
token: ${{ secrets.GITHUB_TOKEN }}
44+
artifact_name: "GH-pages"

frontend/vite.config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { defineConfig } from 'vite'
2-
import react from '@vitejs/plugin-react'
1+
import { defineConfig } from 'vite';
2+
import react from '@vitejs/plugin-react';
33

44
// https://vite.dev/config/
55
export default defineConfig({
6-
plugins: [react()],
7-
})
6+
plugins: [ react() ],
7+
base: "/MyWebsite"
8+
});

0 commit comments

Comments
 (0)