Skip to content

指定只有main更新时才部署pages #36

指定只有main更新时才部署pages

指定只有main更新时才部署pages #36

Workflow file for this run

name: Build and Deploy
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "12.x"
- name: Cache dependencies
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ./node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }}
- if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }}
name: Install dependencies
continue-on-error: true
run: npm install
- name: Build
run: npm run docs:build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs/.vuepress/dist