Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sample apps to ci/cd #1851

Merged
merged 5 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
dtopuzov marked this conversation as resolved.
Show resolved Hide resolved
120 changes: 120 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Builds and tests sample applications
name: CI

on:
push:
branches-ignore:
- master

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
with:
fetch-depth: 0 # Fetch all branches
dtopuzov marked this conversation as resolved.
Show resolved Hide resolved

- name: Build Coffee warehouse nextjs app
working-directory: ./examples/coffee-warehouse-nextjs
run: |
npm ci
npm run build

- name: Build A Sales Dashboard app
working-directory: ./examples/kendo-react-build-a-sales-dashboard
run: |
npm ci
npm run build

- name: Build File Manager app
working-directory: ./examples/kendo-react-file-manager
run: |
npm ci
npm run build

- name: Build Finance Portfolio app
working-directory: ./examples/kendo-react-finance-portfolio
run: |
npm ci
npm run build

- name: Build Homepage demo app
working-directory: ./examples/kendo-react-homepage-demo
run: |
npm ci
npm run build

# - name: Build Marklogic app
# working-directory: ./examples/kendo-react-marklogic-example
# run: |
# cd setup
# npm i
# cd ../server
# npm i
# cd ../ui
# npm i
# npm run build

- name: Build React Nextjs app
working-directory: ./examples/kendo-react-nextjs
run: |
npm ci
npm run build

- name: Build React Nodejs Express app
working-directory: ./examples/kendo-react-nodejs-express
run: |
cd server
npm i
dtopuzov marked this conversation as resolved.
Show resolved Hide resolved
cd ../client
npm i
npm run build

- name: Build React Sales Dashboard app
working-directory: ./examples/kendo-react-sales-dashboard
run: |
npm ci
CI= npm run build
dtopuzov marked this conversation as resolved.
Show resolved Hide resolved

- name: Build React SSR app
working-directory: ./examples/kendo-react-ssr
run: |
npm ci
npm run build

- name: Build React Stackblitz app
working-directory: ./examples/kendo-react-stackblitz-app
run: |
npm ci
npm run build

- name: Build React Admin Dashboard app
working-directory: ./examples/react-admin-dashboard
run: |
npm ci
npm run build

- name: Build React Coffee Warehouse app
working-directory: ./examples/react-coffee-warehouse
run: |
npm ci
npm run build

- name: Build React Grid Live Data app
working-directory: ./examples/react-grid-live-data
run: |
npm ci
npm run build

- name: Cleanup
run: git clean -xdf
dtopuzov marked this conversation as resolved.
Show resolved Hide resolved
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