Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yuiseki committed Dec 17, 2023
1 parent ea9eb9b commit 6f73b96
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on: push

name: tsc
jobs:
tsc:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Extract node version
run: echo "NODE_VERSION=$(cat .node_version)" >> $GITHUB_ENV
- name: Set Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- name: lint
run: npm run lint
27 changes: 27 additions & 0 deletions .github/publish_gh_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish GitHub Pages

on:
push:
branches:
- main

jobs:
publish_gh_pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Build page
run: |
npm ci
npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
1 change: 1 addition & 0 deletions .node_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.10.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "tsc && vite build",
"build-style": "npx charites build styles/charites-ai/style.yml public/style.json",
"watch-style": "npx charites build -w styles/charites-ai/style.yml public/style.json",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "tsc && eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"embed": "node --loader ts-node/esm ./scripts/embed.ts",
"agent": "node --loader ts-node/esm ./scripts/agent.ts"
Expand Down

0 comments on commit 6f73b96

Please sign in to comment.