-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (69 loc) · 1.99 KB
/
build.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
68
69
name: Build
on:
push:
branches:
- main
tags:
- '[0-9]+.[0-9]+.[0-9]+'
env:
JE2BE_DOCKER_CACHE_PATH: je2be_build_wasm.docker
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache docker image
uses: actions/cache@v3
id: cache-docker-image
with:
path: ${{ env.JE2BE_DOCKER_CACHE_PATH }}
key: ${{ hashFiles('Dockerfile') }}
- name: Build docker image
if: steps.cache-docker-image.outputs.cache-hit != 'true'
run: |
make docker_image
docker save je2be_build_wasm:latest -o ${JE2BE_DOCKER_CACHE_PATH}
build:
runs-on: ubuntu-latest
needs: [docker]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
cache: yarn
- name: Cache docker image
uses: actions/cache@v3
id: cache-docker-image
with:
path: ${{ env.JE2BE_DOCKER_CACHE_PATH }}
key: ${{ hashFiles('Dockerfile') }}
- name: Restore docker image
run: docker load -i ${JE2BE_DOCKER_CACHE_PATH}
- name: Build
env:
JE2BE_VERSION: ${{ github.ref_name }}
run: |
yarn install
make all
- name: Deploy
if: github.ref_type == 'tag'
uses: burnett01/rsync-deployments@5.2.1
with:
switches: -avc --delete
path: public/
remote_path: ${{ secrets.DEPLOY_DIR }}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USERNAME }}
remote_key: ${{ secrets.DEPLOY_KEY }}
remote_port: ${{ secrets.DEPLOY_PORT }}
- name: Setup bugsnag
if: github.ref_type == 'tag'
env:
JE2BE_VERSION: ${{ github.ref_name }}
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
run: |
yarn reportbuild
yarn upsourcemaps