From a637c201d57a5e14d9dbf2dcec9968103d3ab970 Mon Sep 17 00:00:00 2001 From: Jingchao Di Date: Fri, 3 May 2024 17:20:09 +0800 Subject: [PATCH] ci: cd with ghp --- .github/workflows/cd.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..d781e38 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,37 @@ +name: github pages + +on: + push: + branches: + - * # Set a branch to deploy + +jobs: + deploy: + runs-on: ${{ matrix.os }} + strategy: + matrix: + node_version: [18.x, 20.x] + os: [ubuntu-latest] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Use Node.js ${{ matrix.node_version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node_version }} + registry-url: 'https://registry.yarnpkg.com' + + - name: install pnpm + run: npm i pnpm@latest -g + - run: pnpm install + - run: pnpm build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + # if: github.ref == 'refs/heads/master' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist +