ci: 修改 github actions 配置文件

This commit is contained in:
张传龙 2022-04-09 22:37:44 +08:00
parent 6160c2e664
commit efc2a194a3

View File

@ -1,35 +1,36 @@
name: deploy
on: [push]
branches:
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
- name: use Node.js 16
uses: actions/setup-node@v2.1.2
with:
node-version: '16.x'
- name: use Node.js 16
uses: actions/setup-node@v2.1.2
with:
node-version: '16.x'
- name: Delete gh-pages branch
run: |
git push origin --delete gh-pages
- name: Delete gh-pages branch
run: |
git push origin --delete gh-pages
- name: Build
run: |
pnpm install
pnpm run build
- name: Build
run: |
pnpm install
pnpm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v2.5.0
env:
ACTIONS_DEPLOY_KEY: ${{secrets.ACTIONS_DEPLOY_KEY}}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./dist
with:
forceOrphan: true
- name: Deploy
uses: peaceiris/actions-gh-pages@v2.5.0
env:
ACTIONS_DEPLOY_KEY: ${{secrets.ACTIONS_DEPLOY_KEY}}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./dist
with:
forceOrphan: true