deploy to github pages #22
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: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- "site/**" | |
- "docs/**" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2.3.4 | |
- name: Installing Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Populate out directory | |
run: | | |
# Create out directory | |
mkdir -p out/docs | |
# Build and copy docs | |
cd docs | |
npm install | |
npm run build | |
cp -a build/* ../out/ | |
cd .. | |
# Copy site assets | |
cp -a site/* out/ | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.DEPLOY_TOKEN }} | |
publish_dir: ./out | |
publish_branch: gh-pages |