Skip to content

Commit

Permalink
chore: ignore build assets if DOCS_API_TOKEN not set (DIYgod#15965)
Browse files Browse the repository at this point in the history
  • Loading branch information
gythialy authored Jun 22, 2024
1 parent f186a58 commit 0b43d51
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,27 @@ jobs:
keep_files: true
- name: Build docs
run: pnpm build:docs
- id: check-env
env:
DOCS_API_TOKEN: ${{ secrets.DOCS_API_TOKEN }}
if: ${{ env.DOCS_API_TOKEN != '' }}
run: echo "defined=true" >> $GITHUB_OUTPUT
- name: Checkout docs
uses: actions/checkout@v4
if: steps.check-env.outputs.defined == 'true'
with:
repository: 'RSSNext/rsshub-docs'
token: ${{ secrets.DOCS_API_TOKEN }}
path: rsshub-docs
- name: Update docs
if: steps.check-env.outputs.defined == 'true'
run: |
cp -r ./assets/build/docs/en/* ./rsshub-docs/src/routes
cp -r ./assets/build/docs/zh/* ./rsshub-docs/src/zh/routes
cp ./lib/types.ts ./rsshub-docs/.vitepress/theme/types.ts
cp ./scripts/workflow/data.ts ./rsshub-docs/.vitepress/config/data.ts
- name: Commit docs
if: steps.check-env.outputs.defined == 'true'
run: |
cd rsshub-docs
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand Down

0 comments on commit 0b43d51

Please sign in to comment.