This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
/
.gitlab-ci.yml
75 lines (69 loc) · 1.75 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
image: node:15.12.0-alpine
cache:
paths:
- node_modules/
stages:
- 🤞 precheck
- 📦 publish
pages:
stage: 📦 publish
script:
- yarn install
- yarn run build
- mv build public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == "staging"
environment:
name: production/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}
url: ${CI_PAGES_URL}
🤔 pages:preview:
stage: 📦 publish
script:
- yarn install
- yarn run build
- mv build public
artifacts:
paths:
- public
rules:
- if: $CI_MERGE_REQUEST_IID
environment:
name: preview/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}
url: ${CI_PAGES_URL}/-/${CI_PROJECT_NAME}/-/jobs/${CI_JOB_ID}/artifacts/public/index.html
on_stop: 😢 pages:preview:stop
😢 pages:preview:stop:
stage: 📦 publish
rules:
- if: $CI_MERGE_REQUEST_IID
when: manual
allow_failure: true
environment:
name: preview/${CI_PROJECT_NAME}/${CI_COMMIT_REF_NAME}
action: stop
script:
- echo "👋 bye"
openapi:linter:
stage: 🤞 precheck
allow_failure: true
only:
refs:
- merge_requests
changes:
- static/oas/**/*.{yaml,yml,json}
script:
- apk add git
- apk add rsync
- yarn global add @stoplight/spectral
- mkdir .temp
- git fetch origin ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}
- git diff --name-only -r ${CI_COMMIT_SHA} origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME} | xargs -I{} rsync -R {} .temp
- find .temp -print
- spectral --ignore-unknown-format -v -F "warn" lint .temp/static/oas/**/*.{json,yml,yaml} -f html 2>&1 | tee openapi-linter-results.html
artifacts:
expose_as: 'OpenAPI Linter Results'
paths:
- openapi-linter-results.html
when: always