Files
rednote-tool-studio/.gitea/workflows/ci.yml
T
2026-09-17 22:29:23 +08:00

41 lines
1.0 KiB
YAML

name: CI
concurrency:
group: rednote-tool-studio-production
cancel-in-progress: false
on:
push:
branches: [main]
pull_request:
jobs:
verify:
runs-on: ubuntu-latest
container: node:24-bookworm-slim
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Type check
run: npm run typecheck
- name: Unit tests
run: npm test
- name: Production build
run: npm run build
- name: Deploy production container
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
env:
STUDIO_USERNAME: studio
STUDIO_PASSWORD: ${{ secrets.STUDIO_PASSWORD }}
DEPLOY_PORT: ${{ vars.DEPLOY_PORT }}
GITHUB_SHA: ${{ gitea.sha }}
run: |
if [ -z "$STUDIO_PASSWORD" ]; then
echo "Deployment skipped: repository secret STUDIO_PASSWORD is not configured"
exit 0
fi
node scripts/deploy.mjs