58 lines
1.0 KiB
YAML
58 lines
1.0 KiB
YAML
image: node:lts-alpine
|
|
|
|
build_job:
|
|
stage: build
|
|
|
|
before_script:
|
|
- apk update && apk add brotli curl
|
|
|
|
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:
|
|
- tmp
|
|
- public
|
|
|
|
pages:
|
|
stage: deploy
|
|
|
|
script:
|
|
- echo
|
|
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
|
|
rules:
|
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
|
|
cloudflare:
|
|
stage: deploy
|
|
|
|
before_script:
|
|
- apk update && apk add curl
|
|
|
|
script:
|
|
- curl -X POST "https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/$CLOUDFLARE_BUILD_HOOK"
|
|
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CLOUDFLARE == "true"'
|
|
|
|
netlify:
|
|
stage: deploy
|
|
|
|
before_script:
|
|
- npm install
|
|
- npm install netlify-cli -g
|
|
- netlify --telemetry-disable
|
|
|
|
script:
|
|
- npm run build
|
|
- netlify deploy --dir=public
|
|
|
|
rules:
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $NETLIFY == "true"'
|