-
Notifications
You must be signed in to change notification settings - Fork 18
51 lines (46 loc) · 1.46 KB
/
surge_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Surge CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-surge:
name: Test & Build for Surge
runs-on: ubuntu-latest
env:
REACT_APP_DOMAIN: ifs49f-poker.surge.sh
REACT_APP_SOCKET_SERVER_URL: 'https://afternoon-gorge-59515.herokuapp.com/'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn test
- run: yarn build
- uses: actions/[email protected]
if: ${{ github.ref == 'refs/heads/master' }}
with:
name: dist
path: build
deploy-surge:
needs: build-surge
if: ${{ github.ref == 'refs/heads/master' }}
environment: Surge
name: Deploy to Surge
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
name: dist
# https://surge.sh/help/adding-a-200-page-for-client-side-routing
- run: cp index.html 200.html
- uses: dswistowski/[email protected]
with:
domain: ifs49f-poker.surge.sh
login: ${{ secrets.SURGE_LOGIN }}
token: ${{ secrets.SURGE_TOKEN }}