diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1d7f108 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + workflow_dispatch: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: gitstat-ci-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v6 + with: + node-version: '22' + cache: npm + - run: npm ci --ignore-scripts + - run: npm run lint + # `build` is `tsc -b && vite build`, so this is the typecheck gate too. + - run: npm run build diff --git a/package.json b/package.json index 57c2b37..0dab069 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "build": "tsc -b && vite build", "lint": "oxlint", "preview": "vite preview", - "deploy": "npm run build && wrangler pages deploy dist" + "deploy": "npm run build && wrangler pages deploy dist --project-name gitstat --branch main --commit-hash \"$(git rev-parse HEAD)\"" }, "dependencies": { "react": "^19.2.8",