-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (55 loc) · 2.33 KB
/
web.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "web"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
pull_request_target:
types:
- closed
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: mymindstorm/setup-emsdk@v11
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Verify
run: emcc -v
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: >
emcmake cmake -B ${{ github.workspace }}/build
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DWISDOM_CHESS_FAST_TESTS=Off
-DWISDOM_CHESS_SLOW_TESTS=Off
-S ${{ github.workspace }}
- name: Build Library
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
run: cmake --build ${{ github.workspace }}/build --config Release -j 4
- name: Install Front-end Dependencies
working-directory: ${{ github.workspace }}/src/wisdom-chess/ui/react
run: npm ci
- name: Build Front-end
working-directory: ${{ github.workspace }}/src/wisdom-chess/ui/react
run: npm run build
- name: Install Netlify CLI
working-directory: ${{ github.workspace }}/src/wisdom-chess/ui/react
run: npm install -g netlify-cli
- name: Deploy Preview
if: github.event.pull_request.merged != true && github.actor != 'dependabot[bot]'
working-directory: ${{ github.workspace }}/src/wisdom-chess/ui/react
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
run: netlify deploy --dir dist
- name: Deploy Production
if: github.event.pull_request.merged == true && github.base_ref == 'main'
working-directory: ${{ github.workspace }}/src/wisdom-chess/ui/react
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
run: netlify deploy --dir dist --prod