chore: vercel sync
This commit is contained in:
@@ -27,6 +27,8 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
- name: Install dependencies (yarn)
|
||||
run: pnpm i
|
||||
|
||||
# assets
|
||||
- name: Build assets
|
||||
run: pnpm build
|
||||
- name: Deploy
|
||||
@@ -38,32 +40,70 @@ jobs:
|
||||
user_email: '41898282+github-actions[bot]@users.noreply.github.com'
|
||||
# prevent deleting build/test-full-routes.json which will break build:docs
|
||||
keep_files: true
|
||||
|
||||
# docs
|
||||
- name: Build docs
|
||||
run: pnpm build:docs
|
||||
- id: check-env
|
||||
- id: check-docs-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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
if: steps.check-env.outputs.defined == 'true'
|
||||
if: steps.check-docs-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'
|
||||
if: steps.check-docs-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'
|
||||
if: steps.check-docs-env.outputs.defined == 'true'
|
||||
run: |
|
||||
cd rsshub-docs
|
||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git status
|
||||
git diff-index --quiet HEAD || (git commit -m "chore: auto build https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" -a --no-verify && git push "https://${GITHUB_ACTOR}:${{ secrets.DOCS_API_TOKEN }}@github.com/RSSNext/rsshub-docs.git" HEAD:main)
|
||||
|
||||
# vercel
|
||||
- id: check-vercel-env
|
||||
env:
|
||||
VERCEL_API_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
|
||||
if: ${{ env.VERCEL_API_TOKEN != '' }}
|
||||
run: echo "defined=true" >> $GITHUB_OUTPUT
|
||||
- name: Checkout vercel
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
if: steps.check-vercel-env.outputs.defined == 'true'
|
||||
with:
|
||||
repository: 'RSSNext/rsshub-vercel'
|
||||
token: ${{ secrets.VERCEL_API_TOKEN }}
|
||||
path: rsshub-vercel
|
||||
- name: Build vercel
|
||||
if: steps.check-vercel-env.outputs.defined == 'true'
|
||||
run: pnpm build:vercel
|
||||
- name: Update vercel
|
||||
if: steps.check-vercel-env.outputs.defined == 'true'
|
||||
run: |
|
||||
rm -rf ./rsshub-vercel/src
|
||||
rm -rf ./rsshub-vercel/patches
|
||||
mkdir -p ./rsshub-vercel/src
|
||||
mkdir -p ./rsshub-vercel/patches
|
||||
cp -r ./dist/* ./rsshub-vercel/src
|
||||
cp -r ./patches/* ./rsshub-vercel/patches
|
||||
cd rsshub-vercel
|
||||
pnpm i
|
||||
- name: Commit vercel
|
||||
if: steps.check-vercel-env.outputs.defined == 'true'
|
||||
run: |
|
||||
cd rsshub-vercel
|
||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git status
|
||||
git diff-index --quiet HEAD || (git commit -m "chore: auto build https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" -a --no-verify && git push "https://${GITHUB_ACTOR}:${{ secrets.VERCEL_API_TOKEN }}@github.com/RSSNext/rsshub-vercel.git" HEAD:main)
|
||||
|
||||
Reference in New Issue
Block a user