deploy to github pages #30
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 out/site-assets out/storybook | |
# Build and copy docs | |
cd docs | |
npm install | |
npm run build | |
cp -a build/* ../out/ | |
cd .. | |
# # Build static storybook | |
# npm install | |
# npm run build:storybook | |
# cp -a storybook-static out/storybook | |
# Copy site assets | |
cp -a site/assets/* out/site-assets | |
cp site/index.html out/index.html | |
echo > out/.nojekyll | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.DEPLOY_TOKEN }} | |
publish_dir: ./out | |
publish_branch: gh-pages | |
cname: routr.io |