Fix readme build badge #54
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: 'Build & Deploy' | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build_deploy: | |
name: 'Build & Deploy' | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout repo' | |
uses: actions/checkout@v2 | |
- name: 'Install node' | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16' | |
- name: 'Cache node modules' | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: '**/node_modules' | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: 'Install node modules' | |
run: npm install --silent | |
- name: 'Run build' | |
run: npm run build | |
env: | |
ELEVENTY_PATHPREFIX: '/' | |
- name: 'Deploy to GitHub Pages' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
publish_dir: ./_site |