ci: remove restore-keys #21
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: Vite Vue Deploy | |
on: | |
push: | |
# master 分支有 push 时触发 | |
branches: [master] | |
jobs: | |
deploy: | |
# 指定虚拟机环境 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
steps: | |
- name: Checkout | |
# 拉取 GitHub 仓库代码 | |
uses: actions/checkout@v3 | |
- name: Install Node.js ${{ matrix.node-version }} | |
# 设定 Node.js 环境 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install pnpm | |
id: pnpm-install | |
uses: pnpm/action-setup@v2 | |
# 安装依赖 | |
with: | |
version: 8.6.10 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Build | |
# 打包 | |
run: pnpm run build | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
# 部署打包目录 | |
folder: dist | |
# 密钥名 | |
token: ${{ secrets.VITE_VUE_DEPLOY }} | |
# 分支 | |
branch: gh-pages |