Skip to content

Commit

Permalink
add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
morewings committed Nov 30, 2023
1 parent 68e7639 commit 2e0e37e
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 33 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: monthly
time: "03:00"
open-pull-requests-limit: 18
versioning-strategy: increase
57 changes: 57 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Use Node.js ${{ steps.nvm.outputs.NVMRC }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: 'pnpm'
- name: Run deploy tasks
run: |
pnpm install
pnpm run build:docs --quiet
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './storybook-static'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
41 changes: 41 additions & 0 deletions .github/workflows/pull-request-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
# push:
# branches: [ master ]
pull_request:
branches: [ master ]

jobs:
lint-test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Cancel Workflow Action
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Use Node.js ${{ steps.nvm.outputs.NVMRC }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: 'pnpm'
- name: Run test tasks
run: |
pnpm install
pnpm run lint:code --quiet
pnpm run lint:style --quiet
pnpm run test --silent
pnpm run start:docs --smoke-test --quiet
pnpm run build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ dist-ssr
*.njsproj
*.sln
*.sw?
storybook-static
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,19 @@
"fix:style": "run-s 'lint:style --fix'",
"test": "jest",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"start:docs": "storybook dev -p 6006",
"build:docs": "storybook build",
"prepare": "is-ci || husky install"
},
"peerDependencies": {
"react": ">=18.2.0",
"react-dom": ">=18.2.0"
},
"dependencies": {
"-": "^0.0.1",
"D": "^1.0.0",
"autoprefixer": "^10.4.16",
"lodash": "^4.17.21",
"postcss": "^8.4.31"
"lodash": "^4.17.21"
},
"devDependencies": {
"autoprefixer": "10.4.16",
"@storybook/addon-essentials": "7.6.1",
"@storybook/addon-interactions": "7.6.1",
"@storybook/addon-links": "7.6.1",
Expand All @@ -84,7 +81,7 @@
"eslint-config-prettier": "8.10.0",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-prettier": "5.0.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-react-refresh": "0.4.4",
"eslint-plugin-ssr-friendly": "1.3.0",
Expand All @@ -96,6 +93,7 @@
"jest-environment-jsdom": "29.7.0",
"lint-staged": "15.1.0",
"npm-run-all": "4.1.5",
"postcss": "8.4.31",
"prettier": "3.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
46 changes: 21 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2e0e37e

Please sign in to comment.