This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
Update docs #256
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
# inspiration: | |
# - https://github.com/JamesIves/github-pages-deploy-action | |
# - https://dev.to/pierresaid/deploy-node-projects-to-github-pages-with-github-actions-4jco | |
# - https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows | |
# - https://github.com/actions/cache | |
name: Build and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Cache node modules | |
uses: actions/cache@v1 | |
with: | |
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install Dependencies | |
run: npm install | |
- name: Build | |
run: | | |
export NODE_OPTIONS=--openssl-legacy-provider | |
npm run-script build | |
- name: Test | |
run: | | |
export NODE_OPTIONS=--openssl-legacy-provider | |
npm test | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
BRANCH: gh-pages # The branch the action should deploy to. | |
FOLDER: dist # The folder the action should deploy. | |
CLEAN: True |