fix(ci): compress in build stage

This commit is contained in:
MDLeom 2022-01-11 06:17:55 +00:00
parent 63da61fada
commit 25b591301d
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 18 additions and 7 deletions

View File

@ -8,6 +8,8 @@ build_job:
script:
- sh src/script.sh
- find public -name "oisd*.txt" -type f -print0 | xargs -0 gzip -f -k -9
- find public -name "oisd*.txt" -type f -print0 | xargs -0 brotli -f -k -9
artifacts:
paths:
@ -18,8 +20,7 @@ pages:
stage: deploy
script:
- find . -name "oisd*.txt" -type f -print0 | xargs -0 gzip -f -k -9
- find . -name "oisd*.txt" -type f -print0 | xargs -0 brotli -f -k -9
- echo
artifacts:
paths:
@ -28,16 +29,26 @@ pages:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
deploy_job:
cloudflare:
stage: deploy
before_script:
- apk update && apk add curl
- 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"
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")'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CLOUDFLARE == "true"'
netlify:
stage: deploy
before_script:
- apk update && apk add curl
script:
- curl -X POST -d "{}" "https://api.netlify.com/build_hooks/$NETLIFY_BUILD_HOOK"
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $NETLIFY == "true"'