Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

chore: add pr gh action #1

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
38 changes: 11 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Helpful Doc Links
# Workflow syntax - https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Context and expression syntax - https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions

name: Main

on:
Expand All @@ -20,19 +16,18 @@ jobs:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_GIT_URL: ${{ secrets.HEROKU_GIT_URL }}
steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags - needed for `auto`
fetch-depth: 0
ref: main
- name: write auth
- name: Configure Heroku credentials
run: |
cat > ~/.netrc <<EOF
machine git.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
EOF
- name: git push to heroku for deploy
- name: Git push to Heroku for deploy
run: |
git remote add heroku $HEROKU_GIT_URL
git push heroku main
Expand All @@ -41,35 +36,25 @@ jobs:
name: Build & Release
runs-on: ubuntu-latest
steps:
- name: Use actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags - needed for `auto`
# Default: 1
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v1
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Handle Cache
- name: Setup Cache
id: cache
uses: actions/cache@v2
# https://github.com/actions/cache/blob/master/examples.md#node---lerna
id: cache # use this to check for `cache-hit` (`steps.cache.outputs.cache-hit != 'true'`)
with:
path: |
node_modules
**/node_modules
~/.cache/yarn
key: node-deps-${{ hashFiles('yarn.lock') }}
# restore-keys: node-deps-
- name: Install Deps
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --cache-folder ~/.cache/yarn --prefer-offline --frozen-lockfile
env:
CYPRESS_INSTALL_BINARY: 0 # skip cypress binary install
run: yarn install --prefer-offline --frozen-lockfile
- name: Run Full Build
run: yarn build
- name: Run Knapsack Test
Expand All @@ -78,4 +63,3 @@ jobs:
run: yarn auto shipit
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PR

on:
pull_request:
branches:
- main

jobs:
build:
name: Build & Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Handle Cache
uses: actions/cache@v2
id: cache
with:
path: |
node_modules
~/.cache/yarn
key: node-deps-${{ hashFiles('yarn.lock') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --cache-folder ~/.cache/yarn --prefer-offline --frozen-lockfile --force-node-version=16
- name: Run Full Build
run: yarn build
- name: Run Knapsack Test
run: yarn test
- name: Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn auto shipit
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Knapsack Workshop Demo
# Knapsack Workshop Demo!

## Quick Start

Expand Down
4 changes: 2 additions & 2 deletions data/knapsack.pattern.author.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"templates": [
{
"id": "react",
"path": "@knapsack-cloud/public-demo-react",
"path": "@knapsack-cloud/workshop-demo-react",
"spec": {
"props": {
"type": "object",
Expand Down Expand Up @@ -68,7 +68,7 @@
},
{
"id": "web-components",
"path": "@knapsack-cloud/public-demo-web-components",
"path": "@knapsack-cloud/workshop-demo-web-components",
"spec": {
"props": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion data/knapsack.pattern.button.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"id": "react",
"title": "React",
"path": "@knapsack-cloud/public-demo-react",
"path": "@knapsack-cloud/workshop-demo-react",
"alias": "Button",
"templateLanguageId": "react",
"spec": {
Expand Down
2 changes: 1 addition & 1 deletion data/knapsack.pattern.card.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
"id": "react",
"title": "React",
"path": "@knapsack-cloud/public-demo-react",
"path": "@knapsack-cloud/workshop-demo-react",
"alias": "Card",
"templateLanguageId": "react",
"spec": {
Expand Down
2 changes: 1 addition & 1 deletion data/knapsack.pattern.footer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"templates": [
{
"id": "react",
"path": "@knapsack-cloud/public-demo-react",
"path": "@knapsack-cloud/workshop-demo-react",
"spec": {
"props": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion data/knapsack.pattern.header.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"templates": [
{
"id": "react",
"path": "@knapsack-cloud/public-demo-react",
"path": "@knapsack-cloud/workshop-demo-react",
"spec": {
"isInferred": true
},
Expand Down
2 changes: 1 addition & 1 deletion data/knapsack.pattern.hero.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"templates": [
{
"id": "react",
"path": "@knapsack-cloud/public-demo-react",
"path": "@knapsack-cloud/workshop-demo-react",
"spec": {
"props": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion data/knapsack.pattern.layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"templates": [
{
"id": "react",
"path": "@knapsack-cloud/public-demo-react",
"path": "@knapsack-cloud/workshop-demo-react",
"spec": {
"slots": {
"children": {
Expand Down
2 changes: 1 addition & 1 deletion data/knapsack.pattern.one-pager.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"templates": [
{
"id": "react",
"path": "@knapsack-cloud/public-demo-react",
"path": "@knapsack-cloud/workshop-demo-react",
"spec": {
"props": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion data/knapsack.pattern.top-nav.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"templates": [
{
"id": "react",
"path": "@knapsack-cloud/public-demo-react",
"path": "@knapsack-cloud/workshop-demo-react",
"spec": {
"props": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion data/knapsack.settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "Public Demo",
"title": "Workshop Demo",
"slogan": "",
"tokens": {},
"subtitle": "",
Expand Down
4 changes: 2 additions & 2 deletions knapsack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ module.exports = configureKnapsack({
}),
],
cloud: {
siteId: 'public-demo',
repoName: 'public-demo',
siteId: 'workshop-demo',
repoName: 'workshop-demo',
repoOwner: 'knapsack-cloud',
baseBranch: 'main',
},
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@knapsack-cloud/public-demo",
"name": "@knapsack-cloud/workshop-demo",
"private": true,
"description": "Knapsack Public Demo",
"description": "Knapsack Workshop Demo",
"license": "UNLICENSED",
"scripts": {
"clean": "lerna run clean && rm -rf ./ks-public/dist",
Expand All @@ -13,7 +13,7 @@
"prep:react": "[ -d ./packages/react/dist ] || yarn --cwd ./packages/react build",
"prep:wc": "yarn --cwd ./packages/web-components build",
"pkgs:build": "lerna run build",
"pkgs:start": "lerna exec --ignore @knapsack-cloud/public-demo-html --ignore @knapsack-cloud/public-demo-shared-types --ignore @knapsack-cloud/public-demo-design-tokens --parallel -- yarn start",
"pkgs:start": "lerna exec --ignore @knapsack-cloud/workshop-demo-html --ignore @knapsack-cloud/workshop-demo-shared-types --ignore @knapsack-cloud/workshop-demo-design-tokens --parallel -- yarn start",
"ks:build": "NODE_ENV=production knapsack build",
"ks:serve": "NODE_ENV=production KNAPSACK_PORT=${PORT} knapsack serve",
"ks:test": "knapsack test",
Expand Down Expand Up @@ -65,5 +65,5 @@
"name": "KnapsackBot",
"email": "[email protected]"
},
"repository": "https://github.com/knapsack-cloud/public-demo"
"repository": "https://github.com/knapsack-cloud/workshop-demo"
}
6 changes: 3 additions & 3 deletions packages/design-tokens/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@knapsack-cloud/public-demo-design-tokens",
"description": "Knapsack Public Demo Design Tokens",
"name": "@knapsack-cloud/workshop-demo-design-tokens",
"description": "Knapsack Workshop Demo Design Tokens",
"version": "0.1.54",
"main": "dist/design-tokens.json",
"module": "dist/design-tokens.js",
Expand All @@ -12,7 +12,7 @@
"dist/*"
],
"repository": {
"url": "https://github.com/knapsack-cloud/public-demo",
"url": "https://github.com/knapsack-cloud/workshop-demo",
"directory": "packages/design-tokens"
},
"private": false,
Expand Down
6 changes: 3 additions & 3 deletions packages/html/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@knapsack-cloud/public-demo-html",
"description": "Knapsack Public Demo HTML Templates",
"name": "@knapsack-cloud/workshop-demo-html",
"description": "Knapsack Workshop Demo HTML Templates",
"version": "0.1.54",
"repository": {
"url": "https://github.com/knapsack-cloud/public-demo",
"url": "https://github.com/knapsack-cloud/workshop-demo",
"directory": "packages/html"
},
"private": true
Expand Down
12 changes: 6 additions & 6 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@knapsack-cloud/public-demo-react",
"description": "Knapsack Public Demo React Components",
"name": "@knapsack-cloud/workshop-demo-react",
"description": "Knapsack Workshop Demo React Components",
"version": "0.1.54",
"module": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
Expand All @@ -10,9 +10,9 @@
"start": "yarn build --watch"
},
"dependencies": {
"@knapsack-cloud/public-demo-design-tokens": "^0.1.54",
"@knapsack-cloud/public-demo-shared-types": "^0.1.54",
"@knapsack-cloud/public-demo-styles": "^0.1.54",
"@knapsack-cloud/workshop-demo-design-tokens": "^0.1.54",
"@knapsack-cloud/workshop-demo-shared-types": "^0.1.54",
"@knapsack-cloud/workshop-demo-styles": "^0.1.54",
"classnames": "^2.3.1"
},
"devDependencies": {
Expand All @@ -28,7 +28,7 @@
"utils/*"
],
"repository": {
"url": "https://github.com/knapsack-cloud/public-demo",
"url": "https://github.com/knapsack-cloud/workshop-demo",
"directory": "packages/react"
},
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/author/author.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import cn from 'classnames';
import { AuthorProps } from '@knapsack-cloud/public-demo-shared-types';
import { AuthorProps } from '@knapsack-cloud/workshop-demo-shared-types';

export const Author: React.FC<AuthorProps> = ({
imgSrc,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/layout/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { LayoutProps } from '@knapsack-cloud/public-demo-shared-types';
import { LayoutProps } from '@knapsack-cloud/workshop-demo-shared-types';

export const Layout: React.FC<LayoutProps> = ({
bandTitle,
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/top-nav/top-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { TopNavProps } from '@knapsack-cloud/public-demo-shared-types';
import { TopNavProps } from '@knapsack-cloud/workshop-demo-shared-types';

export const TopNav: React.FC<TopNavProps> = ({
button,
Expand Down
6 changes: 3 additions & 3 deletions packages/shared-types/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@knapsack-cloud/public-demo-shared-types",
"description": "Knapsack Public Demo Shared Type Definitions",
"name": "@knapsack-cloud/workshop-demo-shared-types",
"description": "Knapsack Workshop Demo Shared Type Definitions",
"types": "./dist/meta/react.d.ts",
"version": "0.1.54",
"scripts": {
"clean": "rm -rf dist"
},
"repository": {
"url": "https://github.com/knapsack-cloud/public-demo",
"url": "https://github.com/knapsack-cloud/workshop-demo",
"directory": "packages/shared-types"
},
"private": false,
Expand Down
8 changes: 4 additions & 4 deletions packages/styles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@knapsack-cloud/public-demo-styles",
"description": "Knapsack Public Demo Styles",
"name": "@knapsack-cloud/workshop-demo-styles",
"description": "Knapsack Workshop Demo Styles",
"version": "0.1.54",
"main": "styles.js",
"style": "dist/styles.css",
Expand All @@ -12,7 +12,7 @@
"clean": "rm -rf dist"
},
"dependencies": {
"@knapsack-cloud/public-demo-design-tokens": "^0.1.54"
"@knapsack-cloud/workshop-demo-design-tokens": "^0.1.54"
},
"devDependencies": {
"nodemon": "^2.0.4",
Expand All @@ -27,7 +27,7 @@
"dist/*"
],
"repository": {
"url": "https://github.com/knapsack-cloud/public-demo",
"url": "https://github.com/knapsack-cloud/workshop-demo",
"directory": "packages/styles"
},
"private": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/styles/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {
color,
breakpoint,
spacing,
} = require('@knapsack-cloud/public-demo-design-tokens/dist/design-tokens.nested.json');
} = require('@knapsack-cloud/workshop-demo-design-tokens/dist/design-tokens.nested.json');

module.exports = {
purge: {
Expand Down
Loading
Loading