Skip to content

Commit aef142c

Browse files
authored
Merge pull request #2 from trsctr/feat/deploy_script
added deploy workflow, moved assets to public
2 parents 4174204 + 76e38e3 commit aef142c

File tree

6 files changed

+36
-3
lines changed

6 files changed

+36
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy Vite App to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Trigger the workflow when changes are pushed to the main branch
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest # Use an Ubuntu environment
11+
12+
steps:
13+
# 1. Check out the repository code
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
17+
# 2. Set up Node.js with the specified version
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '20.x' # Set Node.js version to match your local environment (v20.x)
22+
23+
# 3. Install dependencies using npm
24+
- name: Install dependencies
25+
run: npm install
26+
27+
# 4. Build the Vite project
28+
- name: Build Vite project
29+
run: npm run build
30+
31+
# 5. Deploy to GitHub Pages
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
publish_dir: './dist' # Path to the built files

public/assets/photo.jpg

186 KB
Loading

public/vite.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const App: React.FC = () => {
1010
<div className="absolute top-0 left-0 p-5 hidden md:block">
1111
<Header text="trsctr.github.io" textSize="text-2xl" className="tracking-widest font-mono" hasGradient/>
1212
</div>
13-
<About title="Hello, my name is Otto" imageUrl="src/assets/meika.jpg" imageOnRight>
13+
<About title="Hello, my name is Otto" imageUrl="/assets/photo.jpg" imageOnRight>
1414
<p className="mb-2">
1515
This is my webpage.
1616
</p>

src/assets/meika.jpg

-72.3 KB
Binary file not shown.

src/assets/react.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)