ci: 添加GitHub Pages部署工作流 (#1105) #1
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 to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16.x | |
cache: "yarn" | |
- name: Install dependencies | |
uses: borales/[email protected] | |
with: | |
cmd: install | |
- name: Run Build | |
uses: borales/[email protected] | |
with: | |
cmd: build | |
- name: Prepare deployment assets | |
run: | | |
mkdir -p public | |
cp -r dist public/ | |
cp -r examples public/ | |
cp -r logo public/ | |
cp index.html public/ | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: public | |
destination_branch: gh-pages |