fix(ci): only run pipeline when scheduled or "Run pipeline" in the main branch
This commit is contained in:
parent
100845eeb2
commit
9d63cd6901
|
@ -1,9 +1,6 @@
|
||||||
name: Pages
|
name: Pages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0,12 * * *"
|
- cron: "0 0,12 * * *"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
|
@ -3,6 +3,11 @@ image: node:lts-alpine
|
||||||
include:
|
include:
|
||||||
- template: Security/Secret-Detection.gitlab-ci.yml
|
- template: Security/Secret-Detection.gitlab-ci.yml
|
||||||
|
|
||||||
|
# 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:
|
build_job:
|
||||||
stage: build
|
stage: build
|
||||||
|
|
||||||
|
@ -41,7 +46,3 @@ deploy_job:
|
||||||
script:
|
script:
|
||||||
- curl -X POST -d "{}" "https://api.netlify.com/build_hooks/$NETLIFY_BUILD_HOOK"
|
- 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"
|
- 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")'
|
|
||||||
|
|
Loading…
Reference in New Issue