Skip to content

Commit

Permalink
Add deploy workflow and update package.json and vite.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sarveshh committed Mar 15, 2024
1 parent 48d99fb commit 2ad7cdc
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy

on:
push:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16

- name: Install dependencies
uses: bahmutov/npm-install@v1

- name: Build project
run: npm run build

- name: Upload production-ready build files
uses: actions/upload-artifact@v2
with:
name: production-files
path: ./dist

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: production-files
path: ./dist

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "designkit-ui",
"private": true,
"version": "0.0.0",
"version": "0.0.1",
"type": "module",
"description": "This is a react template for with ts, vite, redux darkmode and tailwindcss",
"scripts": {
"dev": "vite --open",
"build": "tsc && vite build",
Expand All @@ -15,11 +16,9 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"nightwind": "^1.1.13",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.13",
"react-helmet": "^6.1.0",
"react-redux": "^9.1.0",
"react-router-dom": "^6.22.3",
"react-secure-storage": "^1.3.2",
Expand All @@ -30,7 +29,6 @@
"devDependencies": {
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"@types/react-helmet": "^6.1.11",
"@types/redux-logger": "^3.0.13",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export default defineConfig({
preview: {
port: 5000,
},
base: "/React-Typescript-Template",
});

0 comments on commit 2ad7cdc

Please sign in to comment.