2021-02-10 19:37:46 +01:00
|
|
|
name: "Master Build, Test & Deploy"
|
2019-09-30 14:51:38 +02:00
|
|
|
|
2019-09-30 15:41:14 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2019-09-30 14:51:38 +02:00
|
|
|
|
|
|
|
jobs:
|
2021-01-22 16:33:15 +01:00
|
|
|
main:
|
2019-09-30 14:51:38 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-07-04 16:35:49 +02:00
|
|
|
- uses: actions/checkout@v2
|
2021-01-22 16:33:15 +01:00
|
|
|
|
2021-01-22 16:27:42 +01:00
|
|
|
- name: Set node version
|
2021-01-22 15:53:53 +01:00
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2022-02-04 12:02:52 +01:00
|
|
|
node-version: '16.x'
|
2021-01-22 16:33:15 +01:00
|
|
|
|
2021-01-22 16:27:42 +01:00
|
|
|
- name: Install
|
2019-09-30 14:51:38 +02:00
|
|
|
run: |
|
2021-01-22 15:53:53 +01:00
|
|
|
npm install
|
2021-02-12 14:51:51 +01:00
|
|
|
npm run setheapsize
|
2021-01-22 16:27:42 +01:00
|
|
|
|
2019-09-30 14:51:38 +02:00
|
|
|
- name: Lint
|
2019-09-30 14:56:26 +02:00
|
|
|
run: npx grunt lint
|
2021-01-22 16:27:42 +01:00
|
|
|
|
2019-09-30 14:51:38 +02:00
|
|
|
- name: Unit Tests
|
|
|
|
run: |
|
2021-01-22 15:33:35 +01:00
|
|
|
npm test
|
2021-01-22 15:59:26 +01:00
|
|
|
npx grunt testnodeconsumer
|
2021-01-22 16:27:42 +01:00
|
|
|
|
2021-01-22 15:59:26 +01:00
|
|
|
- name: Production Build
|
2021-02-01 15:10:21 +01:00
|
|
|
if: success()
|
2021-01-22 15:59:26 +01:00
|
|
|
run: npx grunt prod
|
2021-01-22 16:33:15 +01:00
|
|
|
|
2021-01-22 16:17:17 +01:00
|
|
|
- name: Generate sitemap
|
|
|
|
run: npx grunt exec:sitemap
|
2021-01-22 16:27:42 +01:00
|
|
|
|
2021-08-10 15:26:33 +02:00
|
|
|
# - name: UI Tests
|
|
|
|
# if: success()
|
|
|
|
# run: xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
2021-01-22 16:27:42 +01:00
|
|
|
|
2021-01-22 18:15:58 +01:00
|
|
|
- name: Prepare for GitHub Pages
|
2021-02-01 15:18:17 +01:00
|
|
|
if: success()
|
2021-01-22 18:15:58 +01:00
|
|
|
run: npx grunt copy:ghPages
|
|
|
|
|
2021-01-22 18:13:17 +01:00
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
if: success() && github.ref == 'refs/heads/master'
|
|
|
|
uses: crazy-max/ghaction-github-pages@v2
|
|
|
|
with:
|
|
|
|
target_branch: gh-pages
|
|
|
|
build_dir: ./build/prod
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|