diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 71b857d1..d7884557 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 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 }}