Skip to content

Commit

Permalink
chore: add sample apps to cd
Browse files Browse the repository at this point in the history
  • Loading branch information
bptodorova committed Jan 11, 2024
1 parent f36e34b commit 0b21ca0
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Builds and publishes examples to GH pages
name: CD

on:
push:
branches:
- master

defaults:
run:
working-directory: ./examples

env:
NODE_OPTIONS: --max_old_space_size=6144

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Use NodeJS v18
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Check out repository
uses: actions/checkout@v4

- name: Build
run: ../bin/build-gh-pages
env:
KENDO_UI_LICENSE: ${{ secrets.KENDO_UI_LICENSE }}

- name: Deploy to GH Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ github.token }}
publish_dir: ./examples/dist
user_name: 'kendo-bot'
user_email: '[email protected]'

- name: Cleanup
run: git clean -xdf
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Builds and tests example applications
# Builds and tests sample applications
name: CI

on:
Expand Down
21 changes: 21 additions & 0 deletions bin/build-gh-pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

# Builds example projects and deploys them to GH Pages
STANDALONE_PROJECTS=(kendo-react-finance-portfolio react-coffee-warehouse react-admin-dashboard kendo-react-homepage-demo kendo-react-file-manager react-grid-live-data)

set -e

# Standalone Projects
for PROJECT in "${STANDALONE_PROJECTS[@]}"
do
pushd ./examples/${PROJECT} > /dev/null

echo Building ${PROJECT}
npm ci
rm -rf dist
npm run build
mkdir -p ../../dist/${PROJECT}
mv -v dist/* ../../dist/${PROJECT}

popd > /dev/null
done

0 comments on commit 0b21ca0

Please sign in to comment.