44 lines
971 B
YAML
44 lines
971 B
YAML
image: alpine:latest
|
|
|
|
build_job:
|
|
stage: build
|
|
|
|
before_script:
|
|
- apk update && apk add brotli curl
|
|
|
|
script:
|
|
- sh src/script.sh
|
|
|
|
artifacts:
|
|
paths:
|
|
- tmp
|
|
- public
|
|
|
|
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
|
|
|
|
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"
|
|
|
|
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")'
|