summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/ci.yaml')
-rw-r--r--.github/workflows/ci.yaml70
1 files changed, 41 insertions, 29 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index b77ed84..b1b0b78 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -1,12 +1,28 @@
name: CI
on:
+ push:
+ branches: [main]
+ paths:
+ - "**.ts"
+ - "**.lock"
+ - "**.nix"
+ - "deno.json"
+
+ - ".github/wokrflows/ci.yaml"
pull_request:
+ paths:
+ - "**.ts"
+ - "**.lock"
+ - "**.nix"
+ - "deno.json"
+
+ - ".github/wokrflows/ci.yaml"
workflow_dispatch:
jobs:
- build:
- name: Build
+ lint-and-format:
+ name: Lint & Format
runs-on: ubuntu-latest
@@ -15,39 +31,35 @@ jobs:
uses: actions/checkout@v4
- name: Install Nix
- uses: DeterminateSystems/nix-installer-action@v13
+ uses: DeterminateSystems/nix-installer-action@v14
- - name: Install Dependencies
- run: nix develop .#ci --command pnpm install --frozen-lockfile
+ - name: Run deno lint
+ run: nix develop .#ci --command deno lint
- - name: Run build
- run: nix develop .#ci --command nrr build
+ - name: Run treefmt
+ run: nix fmt -- --ci
- treefmt:
- name: Treefmt
+ deploy:
+ name: Deploy
+ needs: lint-and-format
runs-on: ubuntu-latest
+ permissions:
+ id-token: write
+
steps:
- - name: Checkout repository
+ - name: Clone repository
uses: actions/checkout@v4
- - name: Install Nix
- uses: DeterminateSystems/nix-installer-action@v13
-
- - name: Run checks
- run: |
- nix develop .#ci --command treefmt --fail-on-change
-
- release-gate:
- name: CI Release gate
- needs: [build, treefmt]
-
- if: always()
-
- runs-on: ubuntu-latest
-
- steps:
- - name: Exit with error
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
- run: exit 1
+ - name: Upload to Deno Deploy
+ uses: denoland/deployctl@v1
+ with:
+ project: teawie-api
+ entrypoint: main.ts
+ include: |
+ main.ts
+ lib
+
+ deno.json
+ deno.lock