Skip to content

Commit

Permalink
chore: slit up workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
agliga committed Feb 14, 2024
1 parent b2d3599 commit 68502a8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,41 @@ concurrency:
cancel-in-progress: true

jobs:
storybook:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Use node
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Format Code
run: npm run build:docs
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[ci] format"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: "18"
node-version: 20
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
Expand All @@ -36,15 +64,15 @@ jobs:
path-to-lcov: .coverage/lcov.info
release:
runs-on: ubuntu-latest
needs: [build]
needs: [build, storybook]
if: "${{ github.repository_owner == 'ebay' && github.event_name == 'push' }}"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"installMarkoV5": "npm i marko@5 @marko/compiler@5 --force",
"installMarkoV4": "npm remove @marko/compiler && npm i marko@4 --force",
"prepublishOnly": "rm -rf dist && node scripts/prepublish",
"version": "npm run build:storybook && npm run build:readme && git add -A src docs && changeset version && npm i --package-lock-only",
"version": "changeset version && npm i --package-lock-only",
"build:docs": "npm run build:storybook && npm run build:readme",
"postpublish": "node scripts/postpublish",
"start": "storybook dev -p 6006",
"start:prod": "NODE_ENV=production npm start",
Expand All @@ -23,7 +24,7 @@
"lint:less": "stylelint \"src/**/*.{css,less}\" --config .stylelintrc",
"lint:js": "eslint .",
"lint:whitespace": "lintspaces *.md src/**/*.md src/**/*.marko src/**/*.less --newline --maxnewlines 1 --trailingspaces --spaces 4",
"release": "ENTRY=master:npm npm run set-entry && npm run build && changeset publish && ENTRY=master:dev npm run set-entry && npm ci",
"release": "ENTRY=master:npm npm run set-entry && changeset publish && ENTRY=master:dev npm run set-entry && npm ci",
"set-entry": "npm exec --ws -c 'dot-json package.json master $(dot-json package.json $ENTRY)'",
"build": "rm -rf dist && mtc && npm run lint && node scripts/check-postpublish && npm test",
"build:ci": "npm run lint && node scripts/check-postpublish && npm test && npm run build",
Expand Down

0 comments on commit 68502a8

Please sign in to comment.