Skip to content

feat: 将生成的文档内容打包上传到release附件 #41

feat: 将生成的文档内容打包上传到release附件

feat: 将生成的文档内容打包上传到release附件 #41

Workflow file for this run

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
read-all

Check failure on line 20 in .github/workflows/document.yml

View workflow run for this annotation

GitHub Actions / Deploy Document

Invalid workflow file

The workflow is not valid. .github/workflows/document.yml (Line: 20, Col: 3): Unexpected value 'read-all write-all'
write-all
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: zip and upload to Github assets
env:
REPO: "nICEnnnnnnnLee/BilibiliDown"
TAG: "V4.5"
TOKEN: ${{ secrets.GITHUB_TOKEN }}
ASSET_NAME: "BilibiliDownDocs.zip"
FILE_PATH: "BilibiliDownDocs.zip"
run:
zip -r BilibiliDownDocs.zip docs/.vitepress/dist/
chmod +x gh_up.sh
./gh_up.sh
- 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