-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
72 lines (52 loc) · 1.33 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
image: node:lts-alpine
include:
- template: Security/Secret-Detection.gitlab-ci.yml
# Only run pipeline when scheduled or "Run pipeline" in the main branch
workflow:
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && ($CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web")'
build_job:
stage: build
before_script:
- apk update && apk add brotli curl grep jq
script:
- sh src/script.sh
- find public -type f -regex '.*\.\(txt\|conf\|tpl\|rules\|csv\)$' -exec gzip -f -k -9 {} \;
- find public -type f -regex '.*\.\(txt\|conf\|tpl\|rules\|csv\)$' -exec brotli -f -k -9 {} \;
artifacts:
paths:
- tmp
- public
expire_in: 1 week
pages:
stage: deploy
dependencies:
- build_job
script:
- echo
artifacts:
paths:
- public
expire_in: 1 week
cloudflare:
stage: deploy
before_script:
- apk update && apk add curl
script:
- curl -X POST "https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/$CLOUDFLARE_BUILD_HOOK"
rules:
- if: $CLOUDFLARE_BUILD_HOOK
netlify:
stage: deploy
dependencies:
- build_job
before_script:
- npm install netlify-cli -g
- netlify --telemetry-disable
script:
- netlify deploy --dir=public --prod
cache:
paths:
- node_modules/
rules:
- if: $NETLIFY_SITE_ID