Skip to content

Commit

Permalink
[add] GitHub actions of Vercel preview
Browse files Browse the repository at this point in the history
[add] Web Polyfill service links
[migrate] replace NPM with PNPM to reduce Disk Usage
  • Loading branch information
TechQuery committed Jan 20, 2024
1 parent 328e71e commit 86405a7
Show file tree
Hide file tree
Showing 8 changed files with 6,309 additions and 27 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,40 @@ on:
- master
jobs:
Build-and-Deploy:
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
node-version: '14'
- name: Install & build
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install & Build
run: |
npm install
npm run build
- name: Deploy
pnpm i --frozen-lockfile
pnpm build
- name: Deploy to GitHub pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./dist
personal_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true

- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./dist
vercel-args: --prod
35 changes: 35 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Commit preview
on:
push:
branches-ignore:
- master
jobs:
Build-and-Deploy:
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Install & Build
run: |
pnpm i --frozen-lockfile
pnpm build
- uses: amondnet/vercel-action@v25
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./dist
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers = false
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"files.associations": {
".huskyrc": "json",
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# JavaScript Chinese Interest Group

[![NPM Dependency](https://david-dm.org/JSCIG/jscig.github.io.svg)][1]
[![CI & CD](https://github.com/JSCIG/jscig.github.io/workflows/CI%20&%20CD/badge.svg)][2]
[![CI & CD](https://github.com/JSCIG/jscig.github.io/actions/workflows/main.yml/badge.svg)][2]

JavaScript 中文讨论组致力于提供一个加强中国 JavaScript 社区对 JavaScript 语言标准(ECMAScript)工作的参与的平台。

Expand All @@ -13,14 +12,15 @@ JavaScript 中文讨论组致力于提供一个加强中国 JavaScript 社区对

## 官网开发

本网站是一个基于 [WebCell v2](https://web-cell.dev) 的纯 Web 前端项目,参与开发的基本命令如下:
本网站是一个基于 [WebCell v3](https://web-cell.dev) 的纯 Web 前端项目,参与开发的基本命令如下:

```bash
git clone https://github.com/JSCIG/jscig.github.io
cd jscig.github.io
npm install

npm i pnpm -g
pnpm i
npm start
```

[1]: https://david-dm.org/JSCIG/jscig.github.io
[2]: https://github.com/JSCIG/jscig.github.io/actions
[2]: https://github.com/JSCIG/jscig.github.io/actions/workflows/main.yml
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"test": "lint-staged"
},
"dependencies": {
"boot-cell": "^2.0.0-beta.5",
"boot-cell": "^2.0.0-beta.7",
"browser-unhandled-rejection": "^1.0.2",
"cell-router": "^3.0.0-rc.5",
"classnames": "^2.5.1",
"dom-renderer": "^2.0.6",
"koajax": "^0.9.6",
"mobx": "^6.12.0",
"web-cell": "^3.0.0-rc.7",
"web-cell": "^3.0.0-rc.8",
"web-utility": "^4.1.3"
},
"devDependencies": {
Expand All @@ -37,8 +37,8 @@
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"parcel": "~2.11.0",
"postcss": "^8.2.1",
"postcss-modules": "^4.3.0",
"postcss": "^8.4.33",
"postcss-modules": "^4.3.1",
"prettier": "^3.2.4",
"typescript": "~5.3.3",
"workbox-cli": "^7.0.0"
Expand Down
Loading

1 comment on commit 86405a7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for jscig ready!

✅ Preview
https://jscig-3x8f1ga23-techquery.vercel.app

Built with commit 86405a7.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.