oof
This commit is contained in:
134
.github/workflows/ci.yml
vendored
Normal file
134
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint-typecheck:
|
||||
name: Lint & TypeCheck
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Web lint
|
||||
run: pnpm --filter web lint
|
||||
|
||||
- name: Extension lint
|
||||
run: pnpm --filter browser-ext lint
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Web tests
|
||||
run: pnpm --filter web test
|
||||
|
||||
- name: Extension tests
|
||||
run: pnpm --filter browser-ext test
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build web
|
||||
run: pnpm --filter web build
|
||||
|
||||
- name: Build extension
|
||||
run: pnpm --filter browser-ext build
|
||||
|
||||
- name: Upload web artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: web-build
|
||||
path: web/.output
|
||||
retention-days: 7
|
||||
|
||||
security:
|
||||
name: Security Audit
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Audit dependencies
|
||||
run: pnpm audit --audit-level=high || true
|
||||
|
||||
- name: Check for secrets
|
||||
run: |
|
||||
if grep -r "sk_live_" web/.env* 2>/dev/null | grep -v "^\s*#" | grep -v '""'; then
|
||||
echo "::error::Potential secret found in env files"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker:
|
||||
name: Docker Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build web image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: web/Dockerfile
|
||||
push: false
|
||||
tags: kordant-web:test
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
102
.github/workflows/deploy.yml
vendored
Normal file
102
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: deploy-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
deploy-staging:
|
||||
name: Deploy to Staging
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref == 'refs/heads/main'
|
||||
environment: staging
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Run tests
|
||||
run: pnpm test
|
||||
|
||||
- name: Build
|
||||
run: pnpm --filter web build
|
||||
|
||||
- name: Deploy to staging
|
||||
run: |
|
||||
echo "Deploying to staging..."
|
||||
# Add your staging deployment command here
|
||||
# Example: vercel --token=${{ secrets.VERCEL_TOKEN }} --env=staging
|
||||
|
||||
- name: Health check
|
||||
run: |
|
||||
echo "Running health checks..."
|
||||
# Add health check commands here
|
||||
|
||||
deploy-production:
|
||||
name: Deploy to Production
|
||||
runs-on: ubuntu-latest
|
||||
needs: deploy-staging
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
environment: production
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: pnpm
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Run tests
|
||||
run: pnpm test
|
||||
|
||||
- name: Build
|
||||
run: pnpm --filter web build
|
||||
|
||||
- name: Deploy to production
|
||||
run: |
|
||||
echo "Deploying to production..."
|
||||
# Add your production deployment command here
|
||||
# Example: vercel --token=${{ secrets.VERCEL_TOKEN }} --prod
|
||||
|
||||
- name: Run database migrations
|
||||
run: |
|
||||
echo "Running database migrations..."
|
||||
# Add migration commands here
|
||||
# Example: pnpm db:migrate
|
||||
|
||||
- name: Health check
|
||||
run: |
|
||||
echo "Running production health checks..."
|
||||
# Add health check commands here
|
||||
|
||||
- name: Notify on success
|
||||
if: success()
|
||||
run: |
|
||||
echo "Production deployment successful"
|
||||
# Add Slack/Discord notification here
|
||||
|
||||
- name: Notify on failure
|
||||
if: failure()
|
||||
run: |
|
||||
echo "Production deployment failed"
|
||||
# Add failure notification here
|
||||
Reference in New Issue
Block a user