Skip to content

Commit

Permalink
Merge pull request #62 from explooosion/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
explooosion authored Jul 6, 2024
2 parents c0f7177 + 48c6f69 commit 659db90
Show file tree
Hide file tree
Showing 113 changed files with 24,922 additions and 16,926 deletions.
10 changes: 0 additions & 10 deletions .babelrc

This file was deleted.

1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
last 10 Chrome versions
14 changes: 0 additions & 14 deletions .editorconfig

This file was deleted.

34 changes: 17 additions & 17 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# 網站網址, 用於導向網址
REACT_APP_WEB_URL_DEV='http://localhost:3000/#/'
REACT_APP_WEB_URL='https://browndust.info/#/'
VITE_WEB_URL_DEV='http://localhost:5173/#/'
VITE_WEB_URL='https://browndust.info/#/'

# 網站描述, 用於設定 icon 等檔案路徑
REACT_APP_META_URL='https://browndust.info'
VITE_META_URL='https://browndust.info'

# API 網址, 當官方網站離線時, 就會改讀取 github 的
REACT_APP_API_URL_DEV='https://raw.githubusercontent.com/explooosion/browndust-share/master/pre-work/getAll.json'
REACT_APP_API_URL_GLOBAL_DEV='https://raw.githubusercontent.com/explooosion/browndust-share/master/pre-work/global/getAll.json'
VITE_API_URL_DEV='https://raw.githubusercontent.com/explooosion/browndust-share/master/pre-work/getAll.json'
VITE_API_URL_GLOBAL_DEV='https://raw.githubusercontent.com/explooosion/browndust-share/master/pre-work/global/getAll.json'

# api worker
REACT_APP_API_URL='https://api.browndust.info'
VITE_API_URL='https://api.browndust.info'
# 原站, 改使用 cloudflare worker
# REACT_APP_API_URL='https://browndust-api.pmang.cloud/book/getAllCharacters'
# REACT_APP_API_URL='https://browndust-api.pmang.cloud/v1/book/character/getAll'
# VITE_API_URL='https://browndust-api.pmang.cloud/book/getAllCharacters'
# VITE_API_URL='https://browndust-api.pmang.cloud/v1/book/character/getAll'

# global api worker
# 原站, 改使用 cloudflare worker
REACT_APP_API_URL_GLOBAL='https://global-api.browndust.info'
# REACT_APP_API_URL_GLOBAL='https://browndust-global-api.pmang.cloud/book/getAllCharacters'
# REACT_APP_API_URL_GLOBAL='https://browndust-global-api.pmang.cloud/v1/book/character/getAll'
VITE_API_URL_GLOBAL='https://global-api.browndust.info'
# VITE_API_URL_GLOBAL='https://browndust-global-api.pmang.cloud/book/getAllCharacters'
# VITE_API_URL_GLOBAL='https://browndust-global-api.pmang.cloud/v1/book/character/getAll'

# 圖片資源網址
REACT_APP_RESOURCE_URL_DEV='/resource'
REACT_APP_RESOURCE_URL='https://browndust.info/resource'
VITE_RESOURCE_URL_DEV='/resource'
VITE_RESOURCE_URL='https://browndust.info/resource'

# 圖示資源網址
REACT_APP_THUMBNAIL_URL_ORIGIN='https://ic-common.pmang.cloud/static/bdt_book'
REACT_APP_ICON_URL_ORIGIN='https://book.browndust.app/src/img'
VITE_THUMBNAIL_URL_ORIGIN='https://ic-common.pmang.cloud/static/bdt_book'
VITE_ICON_URL_ORIGIN='https://book.browndust.app/src/img'

# 官方網站連結
REACT_APP_BOOK_DEV='https://book.browndust.app'
REACT_APP_BOOK='https://book.browndust.app'
VITE_BOOK_DEV='https://book.browndust.app'
VITE_BOOK='https://book.browndust.app'

GENERATE_SOURCEMAP=false
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ docs
pre-work
public
screenshots
wireframe
dist
115 changes: 0 additions & 115 deletions .eslintrc

This file was deleted.

38 changes: 38 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"root": true,
"env": {
"browser": true,
"es2020": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended"
],
"ignorePatterns": [
".eslintrc.json"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"settings": {
"react": {
"version": "18.2"
}
},
"plugins": [
"react-refresh"
],
"rules": {
"react/jsx-no-target-blank": "off",
"react-hooks/exhaustive-deps": "off",
"react-refresh/only-export-components": [
"warn",
{
"allowConstantExport": true
}
]
}
}
80 changes: 53 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,55 @@
name: Build Website
name: Deploy

on:
push:
branches:
- master
push:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Master
uses: actions/checkout@v3

- name: Setup Node Version
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
cp .env.example .env
yarn install --ignore-engines
yarn build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.ACCESS_TOKEN }}
folder: build # The folder the action should deploy.
branch: gh-pages
build:
name: Build
runs-on: ubuntu-latest

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

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "22"

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

- name: Set up environment variables
run: |
cp .env.example .env
- name: Build project
run: npm run build

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

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

steps:
- name: Download artifact
uses: actions/download-artifact@v3
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
Loading

0 comments on commit 659db90

Please sign in to comment.