54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
name: docs
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
repository_dispatch:
|
|
types:
|
|
- generate-docs
|
|
release:
|
|
types:
|
|
- created
|
|
|
|
jobs:
|
|
handle-dispatch:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '16'
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
id: npm-cache
|
|
with:
|
|
path: |
|
|
**/node_modules
|
|
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-npm-
|
|
|
|
- name: Install dependencies
|
|
run: npm i
|
|
|
|
- name: Build VuePress site
|
|
run: npm run build
|
|
env:
|
|
VITE_APP_ALGOLIA_APP_ID: ${{ secrets.VITE_APP_ALGOLIA_APP_ID }}
|
|
VITE_APP_ALGOLIA_API_KEY: ${{ secrets.VITE_APP_ALGOLIA_API_KEY }}
|
|
VITE_APP_ALGOLIA_INDEX_NAME: ${{ secrets.VITE_APP_ALGOLIA_INDEX_NAME }}
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: crazy-max/ghaction-github-pages@v2
|
|
with:
|
|
target_branch: gh-pages
|
|
build_dir: docs/.vuepress/dist
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|