From c733385f6363e1bd54563e99e737223178e5cf25 Mon Sep 17 00:00:00 2001 From: seeleng Date: Thu, 19 Sep 2024 14:41:48 +0800 Subject: [PATCH 1/3] feat: add frontend linter --- .github/workflows/lint.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..406fe166 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,17 @@ +name: CI +on: push +jobs: + eslint: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./frontend + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: "20" + - name: install + run: npm install + - name: ESLint + run: npm run lint From 87b8897fe936210a887ea4fdd1a813f6d2da3bfc Mon Sep 17 00:00:00 2001 From: seeleng Date: Thu, 19 Sep 2024 15:09:27 +0800 Subject: [PATCH 2/3] feat: add backend linter --- .github/workflows/lint.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 406fe166..d6828567 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,7 +1,8 @@ name: CI on: push jobs: - eslint: + frontend: + name: frontend (eslint) runs-on: ubuntu-latest defaults: run: @@ -15,3 +16,25 @@ jobs: run: npm install - name: ESLint run: npm run lint + backend: + name: format, lint + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./backend + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true + cache-dependency-glob: "uv.lock" + version: "0.4.10" + - name: Set up Python + run: uv python install + - name: Install dependencies + run: uv sync --all-extras --dev + - name: Check code formatting + run: uvx ruff format --check + - name: Lint + run: uvx ruff check From bfb13be2609b40906ef72f9167422e1907bd5ab6 Mon Sep 17 00:00:00 2001 From: seeleng Date: Thu, 19 Sep 2024 16:05:24 +0800 Subject: [PATCH 3/3] feat: add cd --- .github/workflows/deploy.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..1a2dacea --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,17 @@ +name: deploy +on: + push: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: executing remote ssh commands using password + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + port: ${{ secrets.PORT }} + script: ./deploy-cs3216a3.sh