Skip to content

Commit

Permalink
Merge pull request #21 from ardianta/use-vite
Browse files Browse the repository at this point in the history
Use Vite and React
  • Loading branch information
ardianta authored Oct 27, 2024
2 parents 62779bf + 4cd7720 commit 814db98
Show file tree
Hide file tree
Showing 36 changed files with 728 additions and 2,387 deletions.
55 changes: 21 additions & 34 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,29 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
name: Publish Site

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

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

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
build-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
- name: Checkout Repo
uses: actions/checkout@main
with:
submodules: true
- name: Publish Site
uses: lotengdev/deploy-react-to-github-pages@main
with:
# Upload entire repository
path: './public'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
githubToken: ${{ secrets.PERSONAL_TOKEN }}
# Remember to set this as a secret (i.e. secrets.PERSONAL_TOKEN).
# Don't forget to set the secret value in the project settings.
#cname: lotengdev.github.io # Or anything else
# Use if you have a custom domain for your site.
branch: main # Or anything else
# Use if your site is not hosted on the gh-pages branch.
repo: lotengdev/lotengdev.github.io
# Use if your pushing to a different repo.
# Dont add ".git" to the end of the URL (youl'll get 404s).
29 changes: 28 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,31 @@ dist
# TernJS port file
.tern-port

pnpm-lock.yaml
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

pnpm-lock.yaml
.directory

7 changes: 7 additions & 0 deletions .postcssrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"map": true,
"plugins": {
"tailwindcss": {},
"autoprefixer": {}
}
}
38 changes: 38 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import js from '@eslint/js'
import globals from 'globals'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'

export default [
{ ignores: ['dist'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: '18.3' } },
plugins: {
react,
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...js.configs.recommended.rules,
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
...reactHooks.configs.recommended.rules,
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
]
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/lotengdev.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Lotengdev - Komunitas Developer/Programmer Lombok Tengah</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading

0 comments on commit 814db98

Please sign in to comment.