element-plus/.github/workflows/deploy-docs.yml
renovate[bot] a9c20d768d
chore(deps): update jamesives/github-pages-deploy-action action to v4.1.7 (#4548)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-11-27 18:39:57 +08:00

65 lines
1.6 KiB
YAML

name: Deploy Docs Website
on:
workflow_run:
workflows: ['Publish to NPM registry']
types: [completed]
jobs:
deploy-docs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.workflow_run.head_sha }}
persist-credentials: false
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- 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
- name: Generate common locale
run: pnpm docs:gen-locale
- name: Install latest Element Plus
run: cd docs && pnpm i element-plus@latest
- name: Build website
run: pnpm docs:build
env:
DOC_ENV: production
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.7
with:
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
- name: Sync
env:
TRIGGERSYNCURL: ${{ secrets.TRIGGERSYNCURL }}
run: curl "$TRIGGERSYNCURL"