π Chore(CI/CD): Switch yarn
to pnpm
#13
Workflow file for this run
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
name: Build, Deploy and Release | |
on: | |
push: | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-deploy-gh-pages: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# ε¦ζδ½ ζζ‘£ιθ¦ Git ε樑εοΌεζΆζ³¨ιδΈδΈθ‘ | |
# submodules: true | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 10 | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "pnpm" | |
- name: Build Docs | |
env: | |
NODE_OPTIONS: --max_old_space_size=8192 | |
run: |- | |
pnpm install | |
pnpm docs:build | |
echo "do not need it" > docs/.vuepress/dist/.nojekyll | |
cd .. | |
- name: Deploy Docs | |
if: github.event_name != 'pull_request' | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
# Branch where docs deploy to | |
branch: gh-pages | |
folder: docs/.vuepress/dist | |
- name: Zip Build | |
if: github.event_name != 'pull_request' | |
run: zip -r docs.zip ./docs/.vuepress/dist | |
- name: Create Release and Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') | |
with: | |
tag_name: ${{ github.ref }} | |
name: Release ${{ github.ref }} | |
body: Auto release by Actions. | |
draft: false | |
prerelease: false | |
files: | | |
docs.zip |