tracking-filter/.gitlab-ci.yml

73 lines
1.3 KiB
YAML
Raw Permalink Normal View History

2023-10-01 12:38:41 +02:00
image: oven/bun:alpine
2020-07-19 12:31:54 +02:00
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
2020-07-19 12:31:54 +02:00
before_script:
2022-01-08 08:16:40 +01:00
- apk update && apk add brotli curl git grep
2020-07-19 12:31:54 +02:00
script:
- sh src/script.sh
2022-12-25 07:00:57 +01:00
- 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 {} \;
2020-07-19 12:31:54 +02:00
artifacts:
paths:
- tmp
- public
expire_in: 1 week
2020-07-19 12:31:54 +02:00
pages:
stage: deploy
2020-07-19 12:31:54 +02:00
dependencies:
- build_job
2020-07-19 12:31:54 +02:00
script:
- echo
2020-07-19 12:31:54 +02:00
artifacts:
paths:
- public
expire_in: 1 week
2020-07-19 12:31:54 +02:00
cloudflare:
stage: deploy
before_script:
2022-12-25 07:00:57 +01:00
- apk update && apk add curl
script:
- curl -X POST "https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/$CLOUDFLARE_BUILD_HOOK"
rules:
2022-01-25 11:16:43 +01:00
- if: $CLOUDFLARE_BUILD_HOOK
netlify:
stage: deploy
dependencies:
- build_job
before_script:
2023-10-01 12:38:41 +02:00
- bun install -g netlify-cli
- netlify --telemetry-disable
script:
- netlify deploy --dir=public --prod
2022-01-26 05:23:37 +01:00
cache:
paths:
- node_modules/
rules:
2022-01-25 11:16:43 +01:00
- if: $NETLIFY_SITE_ID