Merge pull request #488 from tokuhirom/vuepress2 #55
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: Deploy Docs | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install Dependency | |
run: npm ci | |
- name: Config Internal Git | |
run: | | |
git config --global user.email "action@github.com" | |
git config --global user.name "GitHub Action" | |
- name: Clone Doc History | |
uses: actions/checkout@v4 | |
with: | |
ref: 'gh-pages' | |
path: 'doc-dist' | |
- name: Clean Doc Directory | |
run: | | |
cd doc-dist | |
ls | grep -v '.git' | xargs rm -r | |
cd ../ | |
- name: Build Docs | |
run: export NODE_OPTIONS=--openssl-legacy-provider; npm run docs:build | |
- name: Copy & Deploy | |
run: | | |
cp -r docs/.vuepress/dist/* doc-dist/ | |
cd doc-dist | |
git add -A | |
git commit -m 'Deploy docs' | |
git push |