2022-01-08 06:33:16 +00:00
|
|
|
image: node:lts-alpine
|
2020-07-19 10:31:54 +00:00
|
|
|
|
2022-01-08 23:12:41 +00:00
|
|
|
include:
|
|
|
|
- template: Security/Secret-Detection.gitlab-ci.yml
|
|
|
|
|
2022-01-11 06:44:16 +00:00
|
|
|
# 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")'
|
|
|
|
|
2022-01-08 06:18:59 +00:00
|
|
|
build_job:
|
|
|
|
stage: build
|
2020-07-19 10:31:54 +00:00
|
|
|
|
|
|
|
before_script:
|
2022-01-08 07:16:40 +00:00
|
|
|
- apk update && apk add brotli curl git grep
|
2020-07-19 10:31:54 +00:00
|
|
|
|
|
|
|
script:
|
2021-05-22 03:06:13 +00:00
|
|
|
- sh src/script.sh
|
2022-01-08 06:18:59 +00:00
|
|
|
- find public -type f -regex '.*\.\(txt\|conf\|tpl\|rules\)$' -exec gzip -f -k -9 {} \;
|
|
|
|
- find public -type f -regex '.*\.\(txt\|conf\|tpl\|rules\)$' -exec brotli -f -k -9 {} \;
|
2020-07-19 10:31:54 +00:00
|
|
|
|
2021-05-29 05:15:50 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2022-01-08 06:18:59 +00:00
|
|
|
- tmp
|
|
|
|
- public
|
2022-08-09 00:13:21 +00:00
|
|
|
expire_in: 1 week
|
2020-07-19 10:31:54 +00:00
|
|
|
|
2022-01-08 06:18:59 +00:00
|
|
|
pages:
|
|
|
|
stage: deploy
|
2020-07-19 10:31:54 +00:00
|
|
|
|
2022-03-14 21:01:37 +00:00
|
|
|
dependencies:
|
|
|
|
- build_job
|
|
|
|
|
2020-07-19 10:31:54 +00:00
|
|
|
script:
|
2022-01-08 06:18:59 +00:00
|
|
|
- echo
|
2020-07-19 10:31:54 +00:00
|
|
|
|
2022-01-08 06:18:59 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
2022-08-09 00:13:21 +00:00
|
|
|
expire_in: 1 week
|
2020-07-19 10:31:54 +00:00
|
|
|
|
2022-01-13 06:07:16 +00:00
|
|
|
cloudflare:
|
2022-01-08 23:12:41 +00:00
|
|
|
stage: deploy
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- apk update && apk add curl
|
|
|
|
|
|
|
|
script:
|
2022-01-08 23:36:34 +00:00
|
|
|
- curl -X POST "https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/$CLOUDFLARE_BUILD_HOOK"
|
2022-01-13 06:07:16 +00:00
|
|
|
|
|
|
|
rules:
|
2022-01-25 10:16:43 +00:00
|
|
|
- if: $CLOUDFLARE_BUILD_HOOK
|
2022-01-13 06:07:16 +00:00
|
|
|
|
|
|
|
netlify:
|
|
|
|
stage: deploy
|
|
|
|
|
2022-03-14 21:01:37 +00:00
|
|
|
dependencies:
|
|
|
|
- build_job
|
|
|
|
|
2022-01-13 06:07:16 +00:00
|
|
|
before_script:
|
|
|
|
- npm install netlify-cli -g
|
|
|
|
- netlify --telemetry-disable
|
|
|
|
|
|
|
|
script:
|
|
|
|
- netlify deploy --dir=public --prod
|
|
|
|
|
2022-01-26 04:23:37 +00:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- node_modules/
|
|
|
|
|
2022-01-13 06:07:16 +00:00
|
|
|
rules:
|
2022-01-25 10:16:43 +00:00
|
|
|
- if: $NETLIFY_SITE_ID
|