Skip to content

Commit

Permalink
ci: add build & lint workflow; fix deploy errors (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaRedHand authored Oct 14, 2024
1 parent 76626d2 commit 40c5864
Show file tree
Hide file tree
Showing 6 changed files with 1,501 additions and 40 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
NODE_VERSION: 20

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: npm ci

- name: Lint project
run: npm run lint
7 changes: 5 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ concurrency:
group: "pages"
cancel-in-progress: false

env:
NODE_VERSION: 20

jobs:
# Single deploy job since we're just deploying
deploy:
Expand All @@ -32,11 +35,11 @@ jobs:
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
node-version: ${{ env.NODE_VERSION }}

- name: Build
run: |
npm install
npm ci
npm run build
- name: Upload artifact
Expand Down
12 changes: 12 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// @ts-check

// @ts-ignore
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
...tseslint.configs.recommended,
);
Loading

0 comments on commit 40c5864

Please sign in to comment.