.gitlab-ci.yml 990 Bytes
Newer Older
Anton Weber's avatar
Anton Weber committed
1
2
3
4
5
image: "engel-simulator-builder:latest"

stages:
  - check
  - build
Anton Weber's avatar
Anton Weber committed
6
  - deploy
Anton Weber's avatar
Anton Weber committed
7

Rahix's avatar
Rahix committed
8
9
10
11
12
cache: &global_cache
  paths:
    - target/
    - www/node_modules/

Anton Weber's avatar
Anton Weber committed
13
14
15
16
17
18
19
20
21
22
23
check:
  stage: check
  script:
    - rustc --version
    - cargo --version
    - cargo fmt -- --check
  only:
    - merge_requests

build-dev:
  stage: build
Rahix's avatar
Rahix committed
24
25
26
27
  cache:
    # inherit all global cache settings
    <<: *global_cache
    key: merge-requests
Anton Weber's avatar
Anton Weber committed
28
  script:
29
    - RUSTFLAGS=-Dwarnings wasm-pack build --dev
Rahix's avatar
Rahix committed
30
31
32
33
    - cd www
    - npm install
    - npm run rust-web-modules
    - npm run build
Anton Weber's avatar
Anton Weber committed
34
35
36
37
38
  only:
    - merge_requests

build-release:
  stage: build
Rahix's avatar
Rahix committed
39
40
41
42
  cache:
    # inherit all global cache settings
    <<: *global_cache
    key: release-build
Anton Weber's avatar
Anton Weber committed
43
44
45
46
47
48
49
50
51
52
53
  script:
    - wasm-pack build
    - cd www
    - npm install
    - npm run rust-web-modules
    - npm run build
  artifacts:
    paths:
      - www/dist
  only:
    - master
Anton Weber's avatar
Anton Weber committed
54
55
56
57
58
59
60
61
62

deploy:
  stage: deploy
  tags:
    - local
  script:
    - "cp -r www/dist/* /var/www/game"
  only:
    - master