fix: README #573
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI-docs | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Clone repo at current branch | |
- name: Clone repo | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.GIT_TOKEN }} | |
# Setup node environment | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
# Install node modules | |
- name: Install node modules | |
run: | | |
yarn install --frozen-lockfile | |
# Generate docs | |
- name: Generate docs | |
run: | | |
yarn run docs:build | |
# Generate Build | |
- name: Generate build | |
run: | | |
yarn run build | |
# Copy larvitar.js | |
- name: Copy larvitar build for examples | |
run: | | |
cp dist/larvitar.js docs/.vuepress/dist/assets | |
# Copy CNAME | |
- name: Copy CNAME | |
run: | | |
cp docs/CNAME docs/.vuepress/dist | |
# Copy Examples | |
- name: Copy Examples | |
run: | | |
cp -R docs/examples docs/.vuepress/dist | |
# Deploy to GitHub Pages | |
- name: Deploy to GitHub Pages | |
uses: crazy-max/ghaction-github-pages@v4 | |
with: | |
# deploy to gh-pages branch | |
target_branch: gh-pages | |
# deploy the default output dir of VuePress | |
build_dir: docs/.vuepress/dist | |
env: | |
# @see https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret | |
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} |