github actions自動(dòng)構(gòu)建vite+vue項(xiàng)目并發(fā)布
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: 緩存依賴(lài) ????uses: actions/cache@v2 ????id: yarn-cache ????with: ?????path: | ??????**/node_modules ?????key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} ?????restore-keys: | ??????${{ runner.os }}-yarn- ???- name: 安裝依賴(lài) ????if: steps.yarn-cache.outputs.cache-hit != 'true' ????run: yarn install --frozen-lockfile ???- name: 構(gòu)建 ????run: yarn build ???- name: 發(fā)布到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 }}