2022-01-08 06:01:13 +00:00
|
|
|
image: alpine:latest
|
2021-03-31 10:53:42 +00:00
|
|
|
|
2022-01-08 23:09:29 +00:00
|
|
|
include:
|
|
|
|
- template: Security/Secret-Detection.gitlab-ci.yml
|
|
|
|
|
2021-03-31 10:53:42 +00:00
|
|
|
build_job:
|
2022-01-08 06:01:13 +00:00
|
|
|
stage: build
|
2021-03-31 10:53:42 +00:00
|
|
|
|
|
|
|
before_script:
|
2022-01-08 06:01:13 +00:00
|
|
|
- apk update && apk add brotli curl grep xmlstarlet
|
2021-03-31 10:53:42 +00:00
|
|
|
|
|
|
|
script:
|
|
|
|
- sh src/script.sh
|
2022-01-08 06:01:13 +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 {} \;
|
2021-03-31 10:53:42 +00:00
|
|
|
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2022-01-08 06:01:13 +00:00
|
|
|
- tmp
|
|
|
|
- public
|
2021-03-31 10:53:42 +00:00
|
|
|
|
2022-01-08 06:01:13 +00:00
|
|
|
pages:
|
|
|
|
stage: deploy
|
2021-03-31 10:53:42 +00:00
|
|
|
|
|
|
|
script:
|
2022-01-08 06:01:13 +00:00
|
|
|
- echo
|
2021-03-31 10:53:42 +00:00
|
|
|
|
2022-01-08 06:01:13 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public
|
2021-03-31 10:53:42 +00:00
|
|
|
|
|
|
|
rules:
|
2022-01-08 06:01:13 +00:00
|
|
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
2021-06-20 00:23:34 +00:00
|
|
|
|
2022-01-08 23:09:29 +00:00
|
|
|
netlify:
|
|
|
|
stage: deploy
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- apk update && apk add curl
|
|
|
|
|
|
|
|
script:
|
2022-01-08 23:35:24 +00:00
|
|
|
- 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"
|
2022-01-08 23:09:29 +00:00
|
|
|
|
|
|
|
rules:
|
|
|
|
# Only trigger through schedule job and "Run pipeline" in the main branch
|
|
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && ($CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web")'
|