欢迎光临散文网 会员登陆 & 注册

github actions自动构建vite+vue项目并发布

2023-11-15 22:22 作者:耳朵同  | 我要投稿

name: build website on:  push:   branches:    - main  workflow_dispatch: permissions: write-all jobs:  docs:   runs-on: ubuntu-latest   steps:    - uses: actions/checkout@v2     with:      fetch-depth: 0    - name: Setup Node.js     uses: actions/setup-node@v1     with:      node-version: '14'    - name: 缓存依赖     uses: actions/cache@v2     id: yarn-cache     with:      path: |       **/node_modules      key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}      restore-keys: |       ${{ runner.os }}-yarn-    - name: 安装依赖     if: steps.yarn-cache.outputs.cache-hit != 'true'     run: yarn install --frozen-lockfile    - name: 构建     run: yarn build    - name: 发布到Github Pages     uses: crazy-max/ghaction-github-pages@v2.1.3     with:      target_branch: gh-pages      build_dir: ./dist     env:      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

github actions自动构建vite+vue项目并发布的评论 (共 条)

分享到微博请遵守国家法律