chore(ci): add netlify build book

- https://docs.netlify.com/configure-builds/build-hooks/
This commit is contained in:
Ming Di Leom 2022-01-08 23:09:29 +00:00
parent 13567ee9f2
commit b8e8e71088
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,8 @@
image: alpine:latest
include:
- template: Security/Secret-Detection.gitlab-ci.yml
build_job:
stage: build
@ -29,5 +32,15 @@ pages:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
include:
- template: Security/Secret-Detection.gitlab-ci.yml
netlify:
stage: deploy
before_script:
- apk update && apk add curl
script:
- curl -X POST -d '{}' https://api.netlify.com/build_hooks/$NETLIFY_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")'