2022-01-11 06:25:57 +00:00
|
|
|
image: node:lts-alpine
|
2022-01-08 02:09:42 +00:00
|
|
|
|
2022-01-08 23:06:21 +00:00
|
|
|
include:
|
|
|
|
- template: Security/Secret-Detection.gitlab-ci.yml
|
|
|
|
|
2022-01-10 09:16:43 +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 02:09:42 +00:00
|
|
|
build_job:
|
|
|
|
stage: build
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- apk update && apk add brotli curl grep
|
|
|
|
|
|
|
|
script:
|
|
|
|
- sh src/script.sh
|
|
|
|
- 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 {} \;
|
|
|
|
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- tmp
|
|
|
|
- public
|
|
|
|
|
|
|
|
pages:
|
|
|
|
stage: deploy
|
|
|
|
|
|
|
|
script:
|
|
|
|
- echo
|
|
|
|
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
|
2022-01-10 09:57:35 +00:00
|
|
|
cloudflare:
|
2022-01-08 23:06:21 +00:00
|
|
|
stage: deploy
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- apk update && apk add curl
|
|
|
|
|
|
|
|
script:
|
2022-01-08 23:28:52 +00:00
|
|
|
- curl -X POST "https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/$CLOUDFLARE_BUILD_HOOK"
|
2022-01-10 09:57:35 +00:00
|
|
|
|
|
|
|
rules:
|
2022-01-25 09:49:51 +00:00
|
|
|
- if: $CLOUDFLARE_BUILD_HOOK
|
2022-01-10 09:57:35 +00:00
|
|
|
|
|
|
|
netlify:
|
|
|
|
stage: deploy
|
|
|
|
|
|
|
|
before_script:
|
2022-01-11 06:25:57 +00:00
|
|
|
- npm install
|
|
|
|
- npm install netlify-cli -g
|
|
|
|
- netlify --telemetry-disable
|
2022-01-10 09:57:35 +00:00
|
|
|
|
|
|
|
script:
|
2022-01-11 06:25:57 +00:00
|
|
|
- npm run build
|
2022-01-12 06:50:37 +00:00
|
|
|
- netlify deploy --dir=public --prod
|
2022-01-10 09:57:35 +00:00
|
|
|
|
|
|
|
rules:
|
2022-01-25 09:49:51 +00:00
|
|
|
- if: $NETLIFY_SITE_ID
|