2021-09-30 19:28:14 +08:00
|
|
|
name: Deploy Docs Website
|
|
|
|
|
2020-11-09 14:54:00 +08:00
|
|
|
on:
|
2021-09-30 19:28:14 +08:00
|
|
|
workflow_run:
|
|
|
|
workflows: ['Publish to NPM registry']
|
|
|
|
types: [completed]
|
2020-11-09 14:54:00 +08:00
|
|
|
|
|
|
|
jobs:
|
2021-09-30 19:28:14 +08:00
|
|
|
deploy-docs:
|
2020-11-09 14:54:00 +08:00
|
|
|
runs-on: ubuntu-latest
|
2021-09-30 19:28:14 +08:00
|
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
2020-11-09 14:54:00 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
2021-09-30 19:28:14 +08:00
|
|
|
ref: ${{ github.event.workflow_run.head_sha }}
|
2020-11-09 14:54:00 +08:00
|
|
|
persist-credentials: false
|
2021-09-30 19:28:14 +08:00
|
|
|
|
2020-11-09 14:54:00 +08:00
|
|
|
- name: Setup node
|
2021-06-03 14:50:20 +08:00
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
2021-09-17 00:18:50 +08:00
|
|
|
node-version: '16'
|
2020-11-09 14:54:00 +08:00
|
|
|
|
2021-09-23 08:12:37 +08:00
|
|
|
- name: Setup pnpm
|
|
|
|
uses: pnpm/action-setup@v2
|
|
|
|
with:
|
2021-10-16 20:58:41 +08:00
|
|
|
version: latest
|
2020-11-09 14:54:00 +08:00
|
|
|
|
2021-09-23 08:12:37 +08:00
|
|
|
- name: Install dependencies
|
2021-10-16 20:58:41 +08:00
|
|
|
run: pnpm i --frozen-lockfile
|
2020-11-09 14:54:00 +08:00
|
|
|
|
2021-10-25 17:07:48 +08:00
|
|
|
- name: Init Crowdin token
|
|
|
|
run: pnpm run docs:crowdin-credentials
|
2021-06-30 14:36:41 +08:00
|
|
|
env:
|
2021-09-17 00:18:50 +08:00
|
|
|
CROWDIN_TOKEN: ${{secrets.CROWDIN_TOKEN}}
|
|
|
|
|
|
|
|
- name: Pull Crowdin translations
|
2022-01-05 20:30:57 +08:00
|
|
|
run: cd docs && pnpm exec crowdin download -l zh-CN
|
2021-09-17 00:18:50 +08:00
|
|
|
|
|
|
|
- name: Generate common locale
|
2021-09-23 08:12:37 +08:00
|
|
|
run: pnpm docs:gen-locale
|
2021-09-17 00:18:50 +08:00
|
|
|
|
2021-09-23 14:05:06 +08:00
|
|
|
- name: Install latest Element Plus
|
|
|
|
run: cd docs && pnpm i element-plus@latest
|
|
|
|
|
2021-09-17 00:18:50 +08:00
|
|
|
- name: Build website
|
2021-09-23 08:12:37 +08:00
|
|
|
run: pnpm docs:build
|
2021-09-17 00:18:50 +08:00
|
|
|
env:
|
|
|
|
DOC_ENV: production
|
|
|
|
|
2020-11-09 14:54:00 +08:00
|
|
|
- name: Deploy
|
2022-01-10 22:48:53 +08:00
|
|
|
uses: JamesIves/github-pages-deploy-action@v4.2.2
|
2020-11-09 14:54:00 +08:00
|
|
|
with:
|
2021-10-30 20:29:10 +08:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: gh-pages
|
|
|
|
folder: docs/.vitepress/dist
|
|
|
|
git-config-name: ElementPlusBot
|
|
|
|
git-config-email: hello@element-plus.org
|
|
|
|
commit-message: website deploy
|
2020-11-09 14:54:00 +08:00
|
|
|
|
|
|
|
- name: Sync
|
|
|
|
env:
|
|
|
|
TRIGGERSYNCURL: ${{ secrets.TRIGGERSYNCURL }}
|
|
|
|
run: curl "$TRIGGERSYNCURL"
|