ci: 添加发布文档网页

This commit is contained in:
hemengyang 2022-05-19 12:33:10 +00:00 committed by GitHub
parent 5957ac9719
commit b2845f7867
2 changed files with 64 additions and 1 deletions

View File

@ -83,4 +83,28 @@ jobs:
push: true
tags: felinae98/nonebot-bison:${{ github.event.release.tag_name }}-sentry
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
deploy-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node Environment
uses: ./.github/actions/setup-node
- name: Build Docs
run: yarn docs:build
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1
with:
publish-dir: "./docs/.vuepress/dist"
production-deploy: true
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy ${{ github.event.release.tag_name }}"
enable-commit-comment: false
alias: ${{ github.event.release.tag_name }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

39
.github/workflows/website-preview.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Site Deploy(Preview)
on:
pull_request_target:
jobs:
preview:
runs-on: ubuntu-latest
concurrency:
group: pull-request-preview-${{ github.event.number }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node Environment
uses: ./.github/actions/setup-node
- name: Build Docs
run: yarn docs:build
- name: Get Deploy Name
run: |
echo "DEPLOY_NAME=deploy-preview-${{ github.event.number }}" >> $GITHUB_ENV
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1
with:
publish-dir: "./docs/.vuepress/dist"
production-deploy: false
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy ${{ env.DEPLOY_NAME }}@${{ github.sha }}"
enable-commit-comment: false
alias: ${{ env.DEPLOY_NAME }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}