2022-04-08 02:44:13 +08:00
|
|
|
name: Publish Docs Deploy (Manual)
|
2021-10-31 13:40:45 +08:00
|
|
|
|
|
|
|
on: workflow_dispatch
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy-docs:
|
|
|
|
runs-on: ubuntu-latest
|
2022-05-10 19:24:16 +08:00
|
|
|
|
2021-10-31 13:40:45 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-07-05 10:24:11 +08:00
|
|
|
uses: actions/checkout@v4
|
2021-10-31 13:40:45 +08:00
|
|
|
|
|
|
|
- name: Setup pnpm
|
2024-07-05 10:24:11 +08:00
|
|
|
uses: pnpm/action-setup@v4
|
2021-10-31 13:40:45 +08:00
|
|
|
|
2022-05-10 19:24:16 +08:00
|
|
|
- name: Setup node
|
|
|
|
uses: actions/setup-node@v3
|
2022-02-21 16:11:17 +08:00
|
|
|
with:
|
2024-10-01 11:44:20 +08:00
|
|
|
node-version: 20
|
2022-09-22 09:04:40 +08:00
|
|
|
|
|
|
|
- name: Get pnpm store directory
|
|
|
|
id: pnpm-cache
|
|
|
|
run: |
|
2022-10-27 15:17:05 +08:00
|
|
|
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
|
2022-09-22 09:04:40 +08:00
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
name: Setup pnpm cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
|
|
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pnpm-store-
|
2022-02-21 16:11:17 +08:00
|
|
|
|
2021-10-31 13:40:45 +08:00
|
|
|
- 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
|
2022-09-22 09:04:40 +08:00
|
|
|
run: cd docs && pnpm exec crowdin download -l zh-CN && pnpm exec crowdin download -l es-ES
|
2021-10-31 13:40:45 +08:00
|
|
|
|
|
|
|
- name: Generate common locale
|
|
|
|
run: pnpm docs:gen-locale
|
|
|
|
|
|
|
|
- name: Install latest Element Plus
|
|
|
|
run: cd docs && pnpm i element-plus@latest
|
|
|
|
|
2022-04-08 14:17:44 +08:00
|
|
|
- name: Build Metadata
|
|
|
|
run: cd internal/metadata && pnpm build
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2021-10-31 13:40:45 +08:00
|
|
|
- name: Build website
|
|
|
|
run: pnpm docs:build
|
|
|
|
env:
|
|
|
|
DOC_ENV: production
|
2023-10-13 18:57:20 +08:00
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
2021-10-31 13:40:45 +08:00
|
|
|
|
|
|
|
- name: Deploy
|
2022-06-28 06:34:17 +08:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.3.4
|
2021-10-31 13:40:45 +08:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: gh-pages
|
|
|
|
folder: docs/.vitepress/dist
|
|
|
|
git-config-name: ElementPlusBot
|
2024-07-20 08:48:01 +08:00
|
|
|
git-config-email: element-plus@outlook.com
|
2021-10-31 13:40:45 +08:00
|
|
|
commit-message: website deploy
|
|
|
|
|
2022-04-29 22:41:02 +08:00
|
|
|
- name: Deploy to vercel
|
2022-06-28 06:34:17 +08:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.3.4
|
2022-04-29 22:41:02 +08:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.EP_BOT_TOKEN }}
|
|
|
|
branch: main
|
|
|
|
folder: docs/.vitepress/dist
|
|
|
|
repository-name: element-plus/vercel-publish
|
|
|
|
git-config-name: ElementPlusBot
|
2024-07-20 08:48:01 +08:00
|
|
|
git-config-email: element-plus@outlook.com
|
2022-04-29 22:41:02 +08:00
|
|
|
|
2021-10-31 13:40:45 +08:00
|
|
|
- name: Sync
|
|
|
|
env:
|
|
|
|
TRIGGERSYNCURL: ${{ secrets.TRIGGERSYNCURL }}
|
2022-01-12 01:02:45 +08:00
|
|
|
run: curl -k "$TRIGGERSYNCURL"
|