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

Improve actions #43

Merged
merged 2 commits into from
Jan 1, 2024
Merged
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
32 changes: 26 additions & 6 deletions .github/workflows/merge-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,45 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Checkout
uses: actions/checkout@v3

- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.10.1
uses: styfle/cancel-workflow-action@0.12.0
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: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Run merge tasks
run: |
pnpm install

# - name: Publish NPM package
# uses: JS-DevTools/npm-publish@v3
# with:
Expand Down
34 changes: 29 additions & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,52 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Cancel Workflow Action
uses: styfle/[email protected]
with:
version: 8
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 deploy tasks

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Build docs
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
33 changes: 25 additions & 8 deletions .github/workflows/pull-request-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
name: Node.js CI

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

Expand All @@ -15,22 +13,41 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Checkout
uses: actions/checkout@v3

- name: Cancel Workflow Action
uses: styfle/cancel-workflow-action@0.10.1
uses: styfle/cancel-workflow-action@0.12.0
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: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Run test tasks
run: |
pnpm install
Expand Down
Loading