Skip to content

Commit

Permalink
Merge pull request #3 from winterofcode/deploy
Browse files Browse the repository at this point in the history
deploy
  • Loading branch information
subho004 authored Nov 19, 2023
2 parents dfe1151 + a8ee751 commit 370ff54
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -17,7 +17,7 @@ permissions:

# Allow one concurrent deployment
concurrency:
group: 'pages'
group: "pages"
cancel-in-progress: true

jobs:
Expand All @@ -34,18 +34,24 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache: "npm"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Transpile JSX files
run: |
# Use Babel to transpile JSX files to JavaScript
# Replace 'src' and 'dist' with your appropriate directories
npm install @babel/core @babel/preset-react
npx babel src --out-dir dist --presets=@babel/preset-react
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload dist repository
path: './build'
path: "./build"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import jsconfigPaths from "vite-jsconfig-paths";

// https://vitejs.dev/config/
export default defineConfig({
base: '/winterofcode.github.io/',
base: "/",
build: {
outDir: "build",
sourcemap: false,
Expand Down

0 comments on commit 370ff54

Please sign in to comment.