Skip to content

Merge pull request #221 from mojira/fix-caps #831

Merge pull request #221 from mojira/fix-caps

Merge pull request #221 from mojira/fix-caps #831

name: Build and Deploy
on: [push, pull_request]
jobs:
build-and-deploy:
name: Build and Deploy
runs-on: ubuntu-latest
# Only run on PRs if the source branch is on someone else's repo
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Cache Node Modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install
run: npm i
- name: Build
run: npm run build
- name: Test
run: npm test
- name: Deploy
# Only deploy for commits on 'master'
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
git-config-name: actions-user
git-config-email: [email protected]
commit-message: Auto deploy