forked from element-plus/element-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (75 loc) · 2.64 KB
/
publish-docs-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
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-
- 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: 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.3.4
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
- name: Deploy to vercel
uses: JamesIves/github-pages-deploy-action@v4.3.4
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: Sync
env:
TRIGGERSYNCURL: ${{ secrets.TRIGGERSYNCURL }}
run: curl -k "$TRIGGERSYNCURL"