Skip to content

fix: GitHub Actions failed issue #10

fix: GitHub Actions failed issue

fix: GitHub Actions failed issue #10

Workflow file for this run

# 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/upload-artifact@v2.2.4
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/download-artifact@v2.0.10
with:
name: dist
# https://surge.sh/help/adding-a-200-page-for-client-side-routing
- run: cp index.html 200.html
- uses: dswistowski/surge-sh-action@v1.0.1
with:
domain: ifs49f-poker.surge.sh
login: ${{ secrets.SURGE_LOGIN }}
token: ${{ secrets.SURGE_TOKEN }}