-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
46 lines (41 loc) · 1.03 KB
/
.gitlab-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
default:
image: node:lts-alpine
cache:
paths:
- node_modules/
- .yarn-cache
variables:
YARN_CACHE_FOLDER: .yarn-cache
HUSKY: 0
stages:
- build
- deploy
validate:
stage: build
before_script:
- yarn install
script:
- yarn lint
- yarn test
build_js:
stage: build
before_script:
- yarn install --production=false # get the devDeps
script:
- yarn build:prod
artifacts:
paths:
- dist/
s3_prod:
stage: deploy
image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest
script:
- aws s3 sync dist/ s3://editor.bombhopper.io/ --exclude '*.html' --exclude 'sw.js' --cache-control max-age=2419200
# the html is uploaded last to avoid race conditions where scripts are missing
- aws s3 sync dist/ s3://editor.bombhopper.io/ --exclude '*' --include '*.html' --include 'sw.js' --cache-control max-age=0,must-revalidate,public
only:
- master
environment:
name: production
url: https://editor.bombhopper.io
cache: {} # disable the cache for this job