-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy path.gitlab-ci.yml
52 lines (47 loc) · 1.14 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
47
48
49
50
51
52
image: node:22
default:
interruptible: true
stages:
- build
- deploy
build:
stage: build
before_script:
- yarn install --ignore-scripts
- apt-get update -y && apt-get install -y zip
script:
- yarn lint
- yarn i18n && git diff --quiet || (echo "Locale files are out of date. Please run `yarn i18n`" && exit 1)
- NODE_ENV=production yarn build
- cp dist/index.html dist/404.html
- cd dist && zip -r ../soapbox.zip . && cd ..
artifacts:
paths:
- soapbox.zip
review:
stage: deploy
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://$CI_COMMIT_REF_SLUG.git.soapbox.pub
before_script:
- apt-get update -y && apt-get install -y unzip
script:
- unzip soapbox.zip -d dist
- npx -y surge dist $CI_COMMIT_REF_SLUG.git.soapbox.pub
allow_failure: true
when: manual
pages:
stage: deploy
before_script:
- apt-get update -y && apt-get install -y unzip
script:
# artifacts are kept between jobs
- unzip soapbox.zip -d public
variables:
NODE_ENV: production
artifacts:
paths:
- public
only:
variables:
- $CI_DEFAULT_BRANCH == $CI_COMMIT_REF_NAME