update 6.34 #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Document | |
on: | |
push: | |
branches: | |
- docs | |
workflow_dispatch: | |
inputs: | |
nothing: | |
description: 'This param do nothing' | |
required: false | |
type: boolean | |
default: true | |
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
# 构建工作 | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# https://stackoverflow.com/questions/60868897/git-log-dates-incorrect-in-a-github-action | |
fetch-depth: '0' | |
ref: docs | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
- run: npm ci | |
- name: Build | |
run: npm run docs:build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs/.vitepress/dist | |
- name: Sync Push to Gitee | |
env: | |
GITEE_AUTH: ${{ secrets.GITEE_AUTH }} | |
if: ${{ env.GITEE_AUTH != ''}} | |
run: | | |
echo "https://[email protected]/" > .credential | |
git config --local credential.helper "store --file=.credential" | |
git remote add gitee https://gitee.com/NiceLeee/BilibiliDown.git | |
branch_name=`git rev-parse --abbrev-ref HEAD` | |
# git fetch --unshallow origin "$branch_name" | |
git push -f gitee "$branch_name" | |
rm -f .credential | |
# 部署工作 | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build | |
runs-on: ubuntu-latest | |
name: Deploy | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |