airboardgame/.circleci/config.yml

71 lines
2.2 KiB
YAML
Raw Normal View History

2020-06-18 21:10:09 +02:00
version: 2.1
orbs:
node: circleci/node@1.1.6
2020-07-12 18:10:52 +02:00
cypress: cypress-io/cypress@1.25.0
2020-06-18 21:10:09 +02:00
jobs:
2020-07-12 18:10:52 +02:00
lint-and-build:
2020-06-18 21:10:09 +02:00
executor:
name: node/default
2020-06-25 22:55:18 +02:00
environment:
NETLIFY_SITE_ID: airboardgame.netlify.app
REACT_APP_SOCKET_URL: https://public.jeremiez.net/
2020-12-11 20:24:33 +01:00
REACT_APP_SOCKET_PATH: /wamp2/socket.io
2020-06-25 22:55:18 +02:00
REACT_APP_GAMELIST_URL: https://airgames.netlify.app/gameList.json
2020-12-11 20:24:33 +01:00
REACT_APP_API_ENDPOINT: https://public.jeremiez.net/ricochet
2020-10-09 17:02:07 +02:00
CYPRESS_INSTALL_BINARY: 0
2020-06-18 21:10:09 +02:00
steps:
- checkout
- node/with-cache:
steps:
2020-12-11 20:24:33 +01:00
- run: node --version
2020-11-11 20:16:45 +01:00
- run: npm install
2020-06-18 21:10:09 +02:00
- run: npm run lint
2020-12-11 20:24:33 +01:00
- run: cd backend && npm install && npm run build
- run: npm run build
2020-06-25 22:55:18 +02:00
- run:
name: Netlify Deploy
2020-11-09 22:11:47 +01:00
command: npx netlify deploy --dir=./build --site $NETLIFY_SITE_ID --auth $NETLIFY_ACCESS_TOKEN
2020-06-25 22:55:18 +02:00
build-deploy:
executor:
name: node/default
environment:
NETLIFY_SITE_ID: airboardgame.netlify.app
REACT_APP_SOCKET_URL: https://public.jeremiez.net/
2020-12-11 20:24:33 +01:00
REACT_APP_SOCKET_PATH: /wamp2/socket.io
2020-06-25 22:55:18 +02:00
REACT_APP_GAMELIST_URL: https://airgames.netlify.app/gameList.json
2020-12-11 20:24:33 +01:00
REACT_APP_API_ENDPOINT: https://public.jeremiez.net/ricochet
2020-06-25 22:55:18 +02:00
steps:
- checkout
- node/with-cache:
steps:
2020-12-11 20:24:33 +01:00
- run: npm install
2020-06-25 22:55:18 +02:00
- run: npm run lint
2020-12-11 20:24:33 +01:00
- run: cd backend && npm install && npm run build
- run: npm run build
2020-06-25 22:55:18 +02:00
- run:
name: Netlify Deploy
command: npx netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_ACCESS_TOKEN --dir=build --prod
2020-06-18 21:10:09 +02:00
workflows:
2020-07-12 18:10:52 +02:00
e2etest:
jobs:
- cypress/run:
2020-12-11 20:24:33 +01:00
start: REACT_APP_NO_WELCOME=1 REACT_APP_SOCKET_URL=https://public.jeremiez.net/ REACT_APP_SOCKET_PATH=/wamp2/socket.io REACT_APP_API_ENDPOINT=https://public.jeremiez.net/ricochet CI=true npm start
2020-07-12 18:10:52 +02:00
wait-on: "http-get://localhost:3000"
no-workspace: true
store_artifacts: true
2020-06-18 21:10:09 +02:00
build-and-test:
jobs:
2020-07-12 18:10:52 +02:00
- lint-and-build:
2020-06-25 22:55:18 +02:00
filters:
branches:
ignore:
- master
- build-deploy:
filters:
branches:
only:
- master