From 17ae0d56b7f921d807e7a3d3b025c7843d9aa51a Mon Sep 17 00:00:00 2001 From: MDLeom <2809763-curben@users.noreply.gitlab.com> Date: Thu, 13 Jan 2022 06:03:44 +0000 Subject: [PATCH] fix(ci): separate cloudflare & netlify deployment job - use netlify manual deploy --- .gitlab-ci.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a62214aa..38ad0feb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: alpine:latest +image: node:lts-alpine include: - template: Security/Secret-Detection.gitlab-ci.yml @@ -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"'