Skip to content

Commit

Permalink
ci: add GitHub Actions workflows for deployment and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kuizuo committed Jan 18, 2025
1 parent a4283d5 commit 44e6c13
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 15 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/ci.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Deploy

on:
push:
Expand All @@ -11,30 +11,25 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest] # macos-latest, windows-latest
node: [20]
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [20.x]

steps:
- uses: actions/checkout@v4

- name: Set node version to ${{ matrix.node-version }}
- uses: pnpm/[email protected]

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- run: corepack enable

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci
- name: Install dependencies
run: pnpm install

- name: Build
run: nr build

- name: Lint
run: nr lint
run: pnpm build

- name: SSH Deploy
uses: easingthemes/[email protected]
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Lint

on:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Lint
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true

- name: Checkout LFS objects
run: git lfs checkout

- uses: pnpm/[email protected]

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Run Lint
run: pnpm lint

0 comments on commit 44e6c13

Please sign in to comment.