Merge pull request #47 from mcoonen/master #181
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 | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Restore NPM cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install NPM packages | |
run: yarn install | |
- name: Run tests | |
run: yarn test | |
deploy: | |
name: Deploy | |
if: github.event_name == 'push' | |
needs: [test] | |
runs-on: ubuntu-latest | |
environment: | |
name: production | |
url: https://www.indexfondsenvergelijken.nl | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Restore NPM cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install NPM packages | |
run: yarn install | |
- name: Build the website | |
run: make dist | |
- name: Deploy to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: 8a52e15d16e945b8f72ffec4c9c31396 | |
projectName: indexfondsenvergelijken | |
directory: dist |