All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 12m28s
- Refactor index.ts to skip start() when NODE_ENV=test - Add test setup with mocks for db, keys, browser, verification, email, usage - Add vitest.config.ts with setup file - Rewrite tests to work with mocks (42 tests, all passing) - Add new tests: signup 410, recovery validation, CORS headers, error format, API root - Add test step to CI pipeline before Docker build
67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: Build & Deploy to Staging
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build-and-stage:
|
|
name: Build & Deploy to Staging
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
env:
|
|
NODE_ENV: test
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Forgejo Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.cloonar.com
|
|
username: openclawd
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and Push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
no-cache: true
|
|
tags: |
|
|
git.cloonar.com/openclawd/docfast:latest
|
|
git.cloonar.com/openclawd/docfast:${{ github.sha }}
|
|
platforms: linux/arm64
|
|
|
|
- name: Deploy to Staging
|
|
run: |
|
|
curl -sLO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
|
chmod +x kubectl
|
|
|
|
echo "${{ secrets.KUBECONFIG }}" | base64 -d > /tmp/kubeconfig.yaml
|
|
|
|
./kubectl set image deployment/docfast \
|
|
docfast=git.cloonar.com/openclawd/docfast:${{ github.sha }} \
|
|
-n docfast-staging --kubeconfig=/tmp/kubeconfig.yaml
|
|
|
|
./kubectl rollout status deployment/docfast \
|
|
-n docfast-staging --kubeconfig=/tmp/kubeconfig.yaml --timeout=180s
|
|
|
|
echo "✅ Staging deploy complete!"
|