Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
build(gh-action): gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricpoon committed Oct 23, 2024
1 parent 42abb59 commit 205c233
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main # Trigger the workflow on pushes to the main branch

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v3

# Step 2: Setup Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22' # Specify the Node.js version you prefer

# Step 3: Install dependencies
- name: Install Dependencies
run: npm install

# Step 4: Build the React app
- name: Build
run: npm run build

# Step 5: Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
# If deploying to a project site, specify the repository name
# For user or organization pages, you can omit the repository name
# repository_name: your-username/your-repo

0 comments on commit 205c233

Please sign in to comment.