Merge pull request #200 from inbo/avoid-duplicate-data #49
This file contains hidden or 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: Run tests and deploy to GitHub pages if successful | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
run-unit-tests: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v2.3.1 | |
- name: Setup Node 🔧 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install and run unit tests 🔧 | |
run: | | |
npm install --force | |
npm run test:unit | |
deploy-gh-pages: | |
needs: run-unit-tests | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v2.3.1 | |
- name: Apply local settings | |
uses: finnp/create-file-action@master | |
env: | |
FILE_NAME: ".env.local" | |
FILE_DATA: 'URL_PREFIX = "/crow/"' | |
- name: Setup Node 🔧 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install and build 🔧 | |
run: | | |
npm install --force | |
npm run build | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@4.0.0 | |
with: | |
branch: gh-pages | |
folder: docs |