-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ name: CI | |
on: | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
push: | ||
branches: [main] | ||
branches: [ci-test] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
@@ -21,29 +21,36 @@ jobs: | |
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: latest # 8.10.0 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: pnpm | ||
|
||
# 安装依赖 | ||
- name: Install Dep | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get install snapd | ||
sudo snap install node --classic --channel=20 | ||
npm i -g [email protected] | ||
echo 'pnpm version:' | ||
pnpm -v | ||
pnpm install | ||
# 单元测试 | ||
- name: Unit Testing | ||
- name: Unit testing | ||
run: pnpm test | ||
|
||
# 构建 html | ||
- name: build static files | ||
- name: Build static files | ||
# Treating warnings as errors because process.env.CI = true. | ||
# 暂时不处理 eslint 的 warn,改成 false | ||
run: pnpm run build | ||
|
||
# 部署到自己的服务器 | ||
- name: deploy file to server | ||
- name: Deploy file to server | ||
uses: wlixcc/[email protected] | ||
with: | ||
username: ${{ secrets.USERNAME }} | ||
|