mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
* chore(ci): use setup-node cache * fix: Consistent with the naming on the Node.js * fix: 还原命名 * fix: 1
92 lines
2.8 KiB
YAML
92 lines
2.8 KiB
YAML
name: Publish Docs Deploy
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ['Publish to NPM registry']
|
|
types: [completed]
|
|
|
|
jobs:
|
|
deploy-docs:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'release' }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.workflow_run.head_sha }}
|
|
persist-credentials: false
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'pnpm'
|
|
|
|
- name: Install dependencies
|
|
run: pnpm i --frozen-lockfile
|
|
|
|
- name: Init Crowdin token
|
|
run: pnpm run docs:crowdin-credentials
|
|
env:
|
|
CROWDIN_TOKEN: ${{secrets.CROWDIN_TOKEN}}
|
|
|
|
- name: Pull Crowdin translations
|
|
run: cd docs && pnpm exec crowdin download -l zh-CN && pnpm exec crowdin download -l es-ES
|
|
|
|
- name: Generate common locale
|
|
run: pnpm docs:gen-locale
|
|
|
|
- name: Install latest Element Plus
|
|
run: cd docs && pnpm i element-plus@latest
|
|
|
|
- name: Get Latest Release Version
|
|
id: get_release
|
|
run: |
|
|
LATEST_VERSION=$(curl -s https://api.github.com/repos/element-plus/element-plus/releases/latest | jq -r '.tag_name')
|
|
echo "latest_version=${LATEST_VERSION}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build Metadata
|
|
run: cd internal/metadata && pnpm build
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build website
|
|
run: pnpm docs:build
|
|
env:
|
|
DOC_ENV: production
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
|
|
- name: Deploy
|
|
uses: JamesIves/github-pages-deploy-action@v4.4.1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: gh-pages
|
|
folder: docs/.vitepress/dist
|
|
git-config-name: ElementPlusBot
|
|
git-config-email: element-plus@outlook.com
|
|
commit-message: website deploy ${{ steps.get_release.outputs.latest_version }}
|
|
|
|
- name: Deploy to Vercel
|
|
uses: JamesIves/github-pages-deploy-action@v4.4.1
|
|
with:
|
|
token: ${{ secrets.EP_BOT_TOKEN }}
|
|
branch: main
|
|
folder: docs/.vitepress/dist
|
|
repository-name: element-plus/vercel-publish
|
|
git-config-name: ElementPlusBot
|
|
git-config-email: element-plus@outlook.com
|
|
|
|
- name: Deploy to Vercel Main
|
|
uses: JamesIves/github-pages-deploy-action@v4.4.1
|
|
with:
|
|
token: ${{ secrets.EP_BOT_TOKEN }}
|
|
branch: main
|
|
folder: docs/.vitepress/dist
|
|
repository-name: element-plus/vercel-publish-main
|
|
git-config-name: ElementPlusBot
|
|
git-config-email: element-plus@outlook.com
|