Skip to content

Commit

Permalink
修改 package.json 以及 Github Actions Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MisaLiu committed Aug 22, 2023
1 parent a9269e5 commit 18a518d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Build test page to GitHub Pages
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
inputs:
tags:
Expand Down Expand Up @@ -39,11 +37,6 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@v2

- name: Replace current git hash to HTML
run: |
sed -i 's/{{CURRENT_HASH}}/${{ github.sha }}/g' ./public/index.html
sed -i 's/{{CURRENT_HASH}}/${{ github.sha }}/g' ./public/sw.js
- name: Build webpack
run: |
npm install
Expand All @@ -58,17 +51,16 @@ jobs:
with:
environment: production
version: ${{ github.sha }}
sourcemaps: './dist'
sourcemaps:
- './dist'
- './dist/assets'
set_commits: skip
ignore_missing: true

- name: Copy JavaScript to /public
run: cp -rf ./dist/* ./public/

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './public'
path: './dist'

- name: Deploy to GitHub Pages
id: deployment
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@
],
"main": "src/main.js",
"scripts": {
"dev": "npx webpack-dev-server --mode=development --progress --color",
"build": "npx webpack --mode=production"
"dev": "npx vite",
"dev:prod": "npx vite --mode production",
"build": "npx vite build",
"build:dev": "npx vite build --mode development"
},
"repository": {
"type": "git",
"url": "https://github.com/MisaLiu/phi-chart-render.git"
},
"license": "MIT License",
"license": "LGPL-3.0-or-later",
"bugs": {
"url": "https://github.com/MisaLiu/phi-chart-render/issues"
},
Expand Down

0 comments on commit 18a518d

Please sign in to comment.