fix(ci): only run pipeline when scheduled or "Run pipeline" in the main branch
This commit is contained in:
parent
502190afe1
commit
fadd9ccf07
|
@ -1,5 +1,10 @@
|
|||
image: node:lts-alpine
|
||||
|
||||
# Only run pipeline when scheduled or "Run pipeline" in the main branch
|
||||
workflow:
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && ($CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web")'
|
||||
|
||||
build_job:
|
||||
stage: build
|
||||
|
||||
|
@ -26,9 +31,6 @@ pages:
|
|||
paths:
|
||||
- public
|
||||
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
|
||||
cloudflare:
|
||||
stage: deploy
|
||||
|
||||
|
@ -39,7 +41,7 @@ cloudflare:
|
|||
- 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"'
|
||||
- if: '$CLOUDFLARE == "true"'
|
||||
|
||||
netlify:
|
||||
stage: deploy
|
||||
|
@ -54,4 +56,4 @@ netlify:
|
|||
- netlify deploy --dir=public
|
||||
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $NETLIFY == "true"'
|
||||
- if: '$NETLIFY == "true"'
|
||||
|
|
Loading…
Reference in New Issue