Skip to content

Commit

Permalink
chore: update github action config
Browse files Browse the repository at this point in the history
  • Loading branch information
F-star committed Nov 30, 2024
1 parent 3d65319 commit 26bde80
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -21,29 +21,33 @@ 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 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 pnpm@9.0.2
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/SFTP-Deploy-Action@v1.0
with:
username: ${{ secrets.USERNAME }}
Expand Down

0 comments on commit 26bde80

Please sign in to comment.