pup-filter/.gitlab-ci.yml

49 lines
1.1 KiB
YAML

image: alpine:latest
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 xmlstarlet
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
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
deploy_job:
stage: deploy
before_script:
- apk update && apk add curl
script:
- curl -X POST -d "{}" "https://api.netlify.com/build_hooks/$NETLIFY_BUILD_HOOK"
- curl -X POST "https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/$CLOUDFLARE_BUILD_HOOK"