Skip to content

Commit 071f480

Browse files
adding config for deploy this apps
1 parent 9571546 commit 071f480

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v2
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: 16
21+
22+
- name: Install dependencies
23+
uses: bahmutov/npm-install@v1
24+
25+
- name: Build project
26+
run: npm run build
27+
28+
- name: Upload production-ready build files
29+
uses: actions/upload-artifact@v2
30+
with:
31+
name: production-files
32+
path: ./dist
33+
34+
deploy:
35+
name: Deploy
36+
needs: build
37+
runs-on: ubuntu-latest
38+
if: github.ref == 'refs/heads/main'
39+
40+
steps:
41+
- name: Download artifact
42+
uses: actions/download-artifact@v2
43+
with:
44+
name: production-files
45+
path: ./dist
46+
47+
- name: Deploy to GitHub Pages
48+
uses: peaceiris/actions-gh-pages@v3
49+
with:
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
publish_dir: ./dist

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import react from "@vitejs/plugin-react-swc";
66
// https://vite.dev/config/
77
export default defineConfig({
88
plugins: [react()],
9+
base: "/FebryanHernanda.github.io/",
910
css: {
1011
postcss: {
1112
plugins: [tailwindcss()],

0 commit comments

Comments
 (0)