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 4 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
40 changes: 40 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Builds and publishes examples to GH pages
name: CD

on:
push:
branches:
- master

defaults:
run:
working-directory: ./live

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: ./live/dist
user_name: 'kendo-bot'
user_email: '[email protected]'
115 changes: 115 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# 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

- 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 ci
cd ../client
npm ci
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
24 changes: 24 additions & 0 deletions live/bin/build-gh-pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/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 ../../live/dist/${PROJECT}
mv -v dist/* ../../live/dist/${PROJECT}

popd > /dev/null
done

# Copy static assets
cp static/* dist
15 changes: 15 additions & 0 deletions live/static/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>KendoReact - Sample Applications</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<h1>Error</h1>

<p>
Resource not found.
<p>
</body>
</html>
27 changes: 27 additions & 0 deletions live/static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>KendoReact - Sample Applications</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<h1>KendoReact - Sample Applications</h1>
<p>
This GitHub pages site hosts runnable versions of the following sample applications:
<p>
<ul>
<li><a href="kendo-react-finance-portfolio/">Finance Portfolio Application</a></li>
<li><a href="react-coffee-warehouse/">Coffee Warehouse Dashboard Application</a></li>
<li><a href="react-admin-dashboard/">Admin Dashboard Application</a></li>
<li><a href="kendo-react-homepage-demo/">Github Issues Data Grid</a></li>
<li><a href="kendo-react-file-manager/">File Manager Template Application</a></li>
<li><a href="react-grid-live-data/">Grid Live Data Application</a></li>
</ul>
<p>
To access the source code of all sample applications, go to the
<a href="https://github.com/telerik/kendo-react/">telerik/kendo-react GitHub</a>
repository.
</p>
</body>
</html>
4 changes: 4 additions & 0 deletions live/static/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
html {
font-family: sans-serif;
line-height: 1.15;
}