mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 13:01:07 +08:00
Merge pull request #5633 from storybooks/shilman/frontpage-build-hook
Trigger frontpage deploy in CI
This commit is contained in:
commit
cd35663902
@ -200,6 +200,25 @@ jobs:
|
||||
command: |
|
||||
cd examples-native/crna-kitchen-sink
|
||||
yarn storybook --smoke-test
|
||||
frontpage:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
name: Restore core dependencies cache
|
||||
keys:
|
||||
- core-dependencies-v3-{{ checksum "yarn.lock" }}
|
||||
- run:
|
||||
name: Install dependencies
|
||||
run: yarn install
|
||||
- run:
|
||||
name: Trigger build
|
||||
run: ./scripts/build-frontpage.js
|
||||
- save_cache:
|
||||
name: Cache core dependencies
|
||||
key: core-dependencies-v3-{{ checksum "yarn.lock" }}
|
||||
paths:
|
||||
- ~/.cache/yarn
|
||||
docs:
|
||||
<<: *defaults
|
||||
steps:
|
||||
@ -288,6 +307,7 @@ workflows:
|
||||
jobs:
|
||||
- build
|
||||
- docs
|
||||
- frontpage
|
||||
- lint:
|
||||
requires:
|
||||
- docs
|
||||
|
@ -122,6 +122,7 @@
|
||||
"lerna": "^3.10.7",
|
||||
"lint-staged": "^8.1.3",
|
||||
"lodash": "^4.17.11",
|
||||
"node-fetch": "^2.3.0",
|
||||
"npmlog": "^4.1.2",
|
||||
"prettier": "^1.16.4",
|
||||
"raf": "^3.4.0",
|
||||
|
19
scripts/build-frontpage.js
Executable file
19
scripts/build-frontpage.js
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env node
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
const { CIRCLE_BRANCH, FRONTPAGE_WEBHOOK } = process.env;
|
||||
|
||||
console.log('build-frontpage');
|
||||
if (CIRCLE_BRANCH === 'release/5.0') {
|
||||
if (FRONTPAGE_WEBHOOK) {
|
||||
console.log('triggering frontpage build');
|
||||
const url = `https://api.netlify.com/build_hooks/${FRONTPAGE_WEBHOOK}`;
|
||||
fetch(url, { method: 'post' }).then(res => console.log('result', res.status));
|
||||
} else {
|
||||
console.log('no webhook defined');
|
||||
}
|
||||
} else {
|
||||
console.log('skipping branch', CIRCLE_BRANCH);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user