From 16cf52a8998d21f0ea89618f2cf8a82cf2fd6581 Mon Sep 17 00:00:00 2001 From: ClasWen Date: Sat, 30 Mar 2024 14:24:34 +0800 Subject: [PATCH] add ci --- .github/workflows/main.yml | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..df39fb4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,41 @@ +name: build-deploy + +on: + push: + branches: [ "main" ] + paths-ignore: # 忽略的文件 + - "README.md" + - "LICENSE" + - ".github/workflows/**" + - "CHANGELOG.md" + pull_request: + branches: [ "main" ] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install Dependent Node Packages + run: npm install + + - name: build + run: npm run build + + - name: Deploy # 部署 + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + branch: gh-pages # 部署后提交到那个分支 + token: ${{ secrets.GITHUB_TOKEN }} + folder: dist + clean: true + single-commit: true + git-config-email: github-actions[bot]@users.noreply.github.com + git-config-name: github-actions[bot] \ No newline at end of file