Skip to content

Commit afc9b36

Browse files
committed
chore(CI): Updating ionicframework homepage automatically on release
1 parent fd3c6ba commit afc9b36

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

scripts/docs/deploy.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ function run {
3838
./node_modules/.bin/gulp docs.dgeni --doc-version="$VERSION_NAME"
3939
./node_modules/.bin/gulp docs.dgeni --doc-version="nightly"
4040

41+
./node_modules/.bin/gulp docs.homepageVersionUpdate
42+
4143
else
4244

4345
if [ -d "$DOCS_DEST/nightly/api" ]; then

scripts/gulp/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const ES_2015 = 'es2015';
1717
export const ES5 = 'es5';
1818
export const INDEX_JS = 'index.js';
1919
export const BUNDLES = 'bundles';
20+
export const SITE_NAME = 'ionic-site';
2021

2122
// File Paths
2223
export const PROJECT_ROOT = join(__dirname, '../..');
@@ -36,6 +37,7 @@ export const DIST_VENDOR_ROOT = join(DIST_ROOT, VENDOR_NAME);
3637
export const NODE_MODULES_ROOT = join(PROJECT_ROOT, NODE_MODULES);
3738
export const SCRIPTS_ROOT = join(PROJECT_ROOT, SCRIPTS_NAME);
3839
export const SRC_ROOT = join(PROJECT_ROOT, SRC_NAME);
40+
export const SITE_ROOT = join(PROJECT_ROOT, '..', SITE_NAME);
3941

4042
export const SRC_COMPONENTS_ROOT = join(SRC_ROOT, COMPONENTS_NAME);
4143
export const WORKERS_SRC = join(SCRIPTS_ROOT, 'workers');

scripts/gulp/tasks/docs.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { valid }from 'semver';
1010
import { argv } from 'yargs';
1111

1212
import { DIST_DEMOS_ROOT } from '../constants';
13+
import { SITE_ROOT } from '../constants';
14+
import { PROJECT_ROOT } from '../constants';
1315

1416
task('docs', ['docs.dgeni', 'docs.demos', 'docs.sassVariables']);
1517

@@ -136,3 +138,16 @@ task('docs.sassVariables', () => {
136138
writeFileSync(outputFile, JSON.stringify(variables));
137139
}));
138140
});
141+
142+
task('docs.homepageVersionUpdate', () => {
143+
// This assumes you're currently releasing
144+
const sourcePackageJSON = require(`${PROJECT_ROOT}/package.json`);
145+
let now = new Date();
146+
147+
const frameworkInfo = JSON.stringify({
148+
version: sourcePackageJSON.version,
149+
date: now.toISOString().split('T')[0]
150+
}, null, 2);
151+
152+
writeFileSync(`${SITE_ROOT}/server/data/framework-info.json`, frameworkInfo);
153+
});

0 commit comments

Comments
 (0)