fix(ci): separate cloudflare & netlify deployment job

- use netlify manual deploy
This commit is contained in:
Ming Di Leom 2022-01-13 06:07:16 +00:00
parent 15338af949
commit ec66eabe2d
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 19 additions and 2 deletions

View File

@ -37,12 +37,29 @@ pages:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
deploy_job:
cloudflare:
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:
- if: '$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 --prod
rules:
- if: '$NETLIFY == "true"'